download a file from the server
scp username@servername:/path/filename /var/www/local_dir
scp root@192.168.5.14:/root/bigfish6.jpg / ?
root@192.168.5.14‘s password:
/bigfish6.jpg: Read-only file system // didn‘t work cause i don‘t have write right
upload a local file to the server
scp /path/filename username@servername:/path
scp /Users/nedrain/Desktop/bigfish6.jpg root@192.168.5.15:/root/
// you can see
┌─[root@mycentos]─[~]
└──? $ls
anaconda-ks.cfg bigfish6.jpg
download a directory from the server
scp -r username@servername:/var/www/remote_dir/ /var/www/local_dir
scp -r root@192.168.5.14:/root/ /Users/nedrain/test/
upload a directory to the server
scp -r local_dir username@servername:remote_dir
scp -r /Users/nedrain/test/ root@192.168.5.14:/root/
Linux Remote Upload & Download