使用pscp實現Windows 和 Linux 伺服器間的遠程拷貝檔案,pscplinux

來源:互聯網
上載者:User

使用pscp實現Windows 和 Linux 伺服器間的遠程拷貝檔案,pscplinux

  在工作中,每次部署應用時都需要從本機Windows 伺服器拷貝檔案到Linux 上,有時還將Linux 上的檔案拷到本機,這些操作都是可以使用pscp實現的。下文將詳細描述如何使用:

  PSCP (PuTTY Secure Copy client)是PuTTY 提供的檔案傳輸工具,通過 SSH 串連,在兩台機器之間安全的傳輸檔案,可以用於任何 SSH(包括 SSH v1、SSH v2) 伺服器。

  1、下載:

  可以從http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html下載pscp,並將其放入windows的system32 檔案夾下,這樣在dos命令視窗中就能直接調用使用了。

  2、使用:

  把伺服器上的/root/dir目錄取回本地"C:\My Documents\data\"目錄

  C:\>pscp.exe -r root@IP:/root/dir "C:\My Documents\data\"

  把伺服器上的/root/file檔案取回來本地目前的目錄

  C:\>pscp.exe root@IP:/root/file .

  把本地目錄dir、檔案file傳輸到Linux伺服器的/root/,並指定伺服器連接埠2009

  C:\>pscp.exe -P 2009 -r dir file root@IP:/root/

  把本地檔案file傳輸到Linux伺服器的/root/

  C:\>pscp.exe file IP:/root/

  它會提示你輸入密碼,就像Linux下使用scp那樣。

  注意:#如果使用者名稱用root出現Access denied的錯誤,則將root改為ubuntu等

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.