I want Host B to set up a ssh tunnel to Host A so it can rsync with Host C. Only Host B has keys. All three machines use the same key.
I’ve tried this:
ssh -i ~/.ssh/key -A -R localhost:50000:Host_A:22 Host_C 'sudo -E -s rsync -a -e "ssh -v -l admin -p 50000 -o StrictHostKeyChecking=no" --rsync-path="sudo rsync" /path/ localhost:/path'
However, I’m getting an ssh permission denied error when running the rsync command. I thought thought the
-E -s options in sudo would keep the environment/shell and allow me to use the key but apparently not.
Any ideas on how to do this?