Using rsync from cron on server A to pull files from server B via ssh.
Server A has a passwordless private key, the public key is in authorized_keys on Server B.
I can ssh from Server A to Server B.
To prevent use of ForwardAgent
specific no configuration file:
ssh -F /dev/null -v admin@servera
Once on the server try and ssh in to the server
ssh admin@serverb
"Permission denied (publickey)." as expected.
ssh -v -i /path/to/private_key admin@serverb
Now I am in the server. So the key works. Exit back out and try rsync.
rsync -P --archive --compress --quiet --rsh='ssh -v -i /path/to/private_key -o IdentitiesOnly=yes' admin@serverb:/src/path /dest/path
If it works then try without any ENV set (similar to cron):
env - rsync ...