ssh transfer files via scp (transfer)

transfer files via ssh
SSH into the other machine: ssh remoteIP

scp -rp /path/filename username@remoteIP:/path #Copy the local file to the server
scp -rp username@remoteIP:/path/filename /path #Download the remote file from the server to the local

tar cvzf - /path/ | ssh username@remoteip "cd /some/path/; cat -> path.tar.gz" #Compressed transmission
tar cvzf - /path/ | ssh username@remoteip "cd /some/path/; tar xvzf -" #Compressed transmission a directory and unzip

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326261380&siteId=291194637