2017-08-14 63 views
-1

我正在尝试使用scp从我的工作机器上复制各种文件到我的个人。我使用的代码:scp错误 - 语法,还是别的?

scp [email protected]:~/directory/to/file \ 
    [email protected]:~/Directory/to/copied/file 

当我输入代码时,系统提示输入我的工作计算机密码。我输入密码,错误是:

could not resolve hostname(personal computer) 

在我的代码中是否存在语法错误 - 或者是否还有其他事情正在进行?

+0

这个错误意味着你使用主机名到您的个人电脑无效,请尝试使用ip aaddress –

回答

0

如果您指定了两台远程主机,它将连接到第一台,然后从那里连接到第二台。第二个主机名可能无法从第一个主机名解析/可见,因此失败。有几种可能性,你可以这样做:

  • 连接到您的personal计算机,并做一个传递只有一个遥控器:

    scp [email protected]:~/directory/to/file ~/Directory/to/copied/file 
    
  • 使用-3开关,它会连接到两端的距离当前计算机:

    scp -3 [email protected]:~/directory/to/file \ 
        [email protected]:~/Directory/to/copied/file 
    
相关问题