1. Set up SSH key pair between the same login at two hosts:
- At the Source Host (copy from):
- Do a ssh-keygen -t rsa to generate the private/public key pair
- It is commonly to save it under ~/.ssh as id_rsa and id_rsa.pub
- I would now do a sftp the public key file (id_rsa.pub) to my Target Host and save it under .ssh as authorized_keys2. At the same time, you can add the host key.
- Test it at the Source Host
ssh TargetHost (no User ID required assuming the same account is used on both hosts). - Working? Good!
- #rsync -ave ssh TargetHost:/export/test/ /export/test/
sync'ing from Tager Host to Local Disk - #rsync -ave ssh /export/test/ TargetHost:/export/test/
sync'ing from Tager Host to Local Disk - with Delete option to remove old deleted files
#rsync -ave ssh --delete TargetHost:/export/test/ /export/test/
No comments:
Post a Comment