Windows與Ubuntu通過ssh傳檔案

來源:互聯網
上載者:User

標籤:art   命令   從伺服器   nbsp   path   txt   csharp   rem   username   

  1. ubuntu安裝ssh
sudo apt-get install openssh-server

     2.啟動shh服務

sudo /etc/init.d/ssh start

     3.ssh常用命令

  • 從伺服器上下載檔案
scp [email protected]:/path/filename /var/www/local_dir(本地目錄)

 例如scp [email protected]:/var/www/test.txt  把192.168.0.101上的/var/www/test.txt 的檔案下載到/var/www/local_dir(本地目錄)

  • 上傳本地檔案到伺服器
scp /path/filename [email protected]:/path   

例如scp /var/www/test.php  [email protected]:/var/www/  把本機/var/www/目錄下的test.php檔案上傳到192.168.0.101這台伺服器上的/var/www/目錄中

  • 從伺服器下載整個目錄
scp -r [email protected]:/var/www/remote_dir/(遠程目錄) /var/www/local_dir(本地目錄)

例如:scp -r [email protected]:/var/www/test  /var/www/  

  • 上傳目錄到伺服器
scp  -r local_dir [email protected]:remote_dir

例如:scp -r test  [email protected]:/var/www/   把目前的目錄下的test目錄上傳到伺服器的/var/www/ 目錄

  

 

 

Windows與Ubuntu通過ssh傳檔案

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.