linux scp傳輸檔案

2021-08-07 15:18:59 字數 478 閱讀 3780

在linux下一般用scp這個命令來通過ssh傳輸檔案。

2、上傳本地檔案到伺服器

scp /path/filename username@servername:/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/test  /var/www/  

4、上傳目錄到伺服器

scp  -r local_dir username@servername:remote_dir

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

注:目標伺服器要開啟寫入許可權。

linux scp檔案傳輸命令

在linux下一般用scp這個命令來通過ssh傳輸檔案。2 上傳本地檔案到伺服器 scp path filename username servername path 例如scp var www test.php root 192.168.0.101 var www 把本機 var www 目錄下的...

linux scp指令 檔案傳輸

scp 可選引數 file source 本地檔案位置 root 目標伺服器登陸使用者 123.45.56.789 目標伺服器ip file target 目標檔案位置 應用例項 傳輸檔案 scp home space music 1.root 123.45.56.789 home root oth...

linux scp 免密碼傳輸

最近在做乙個服務端的專案,需要將檔案同步到其他虛擬機器上,所以採用了scp傳輸這個方案。這裡總結下無密碼傳輸配置流程 心情不好,寫個文章發洩 1 獲取 a 機器使用者公鑰 已存在的話可以直接使用,路徑一般是 ssh id ras.pub 不存在的話執行 ssh keygen t rsa 命令建立,一...