1. 程式人生 > >ubuntu 本地和服務器scp文件傳輸

ubuntu 本地和服務器scp文件傳輸

ubun 文件 sudo ubuntu username delete shel efi 文件夾

安裝 SSH(Secure Shell) 服務以提供遠程管理服務

sudo apt-get install ssh

SSH 遠程登入 Ubuntu 機

ssh [email protected]

將 文件/文件夾 從遠程 Ubuntu 機拷至本地(scp)

scp -r [email protected]:/home/username/remotefile.txt .

將 文件/文件夾 從本地拷至遠程 Ubuntu 機(scp)

scp -r localfile.txt [email protected]:/home/username/

將 文件/文件夾 從遠程 Ubuntu 機拷至本地(rsync)

rsync -v -u -a –delete –rsh=ssh –stats [email protected]:/home/username/remotefile.txt .

將 文件/文件夾 從本地拷至遠程 Ubuntu 機(rsync)

rsync -v -u -a –delete –rsh=ssh –stats localfile.txt [email protected]:/home/username/

ubuntu 本地和服務器scp文件傳輸