2017-08-14 50 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 
    
相關問題