1.用ssh登录远程ubuntu主机
(主机ip为:1.2.3.4;用户名:username)
ssh username@1.2.3.4
2.从远程ubuntu主机copy文件/文件夹到本地(scp)
(远程文件夹位置:/home/username/test.txt;本地保存目录为: .(当前目录))
scp username@servername:/path/filename /var/www/local_dir(本地目录)
3.从本地向远程ubuntu主机copy文件/文件夹(scp)
scp /path/filename username@servername:/path/
4.从服务器下载整个目录
scp -r username@servername:/var/www/remote_dir/(远程目录) /var/www/local_dir(本地目录)
5.上传目录到服务器
scp -r local_dir username@servername:remote_dir