rsync over SSH with Key
source link: http://siongui.github.io/2016/05/03/rsync-over-ssh-with-key/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
rsync over SSH with Key
May 03, 2016
Assume you have a remote machine which allows SSH login with key generated in [1]. The user account is foo and the key is stored in the file ~/fookey. The IP of the remote machine is 1.2.3.4.
You want to copy the content of local ~/local_dir/ to remote ~/remote_dir of user foo via the following rsync command:
$ rsync -avz ~/local_dir/ [email protected]:~/remote_dir/ -e 'ssh -i ~/fookey'
References:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK