I’m trying to run an rsync between two servers. I’m basing things off of this post: How to rsync files between two remotes?
What I find missing is how to facilitate the rsync (via ssh) when a key (the same key) is required for logging into each server.
Here’s the closest I’ve got:
ssh -i ~/path/to/pem/file.pem -R localhost:50000:SERVER2:22 ubuntu@SERVER1 ‘rsync -e “ssh -p 50000” -vur /home/ubuntu/test localhost:/home/ubuntu/test’
It seems like the initial connection works properly, however I can’t seem to figure out how to specific the key and username for SERVER2.
Read More