I can do the following:
$local> ssh -A remote1 $remote1> rsync -e "ssh remote2 ssh " remote3:/file . $remote1>
and this works because keys for both
remote2 are in my gnome keyring, and
remote3 doesn't require a password. However the following fails:
$local> ssh -A remote1 "./scriptOnRemote1.sh"
scriptOnRemote1.sh performs the exact same rsync command. It produces the following errors:
Permission denied, please try again. ssh_askpass: exec(/usr/lib64/ssh/ssh-askpass): No such file or directory Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: unexplained error (code 255) at io.c(235) [Receiver=3.1.0]
The difference between the verbose outputs of those two cases starts with
pubkey_prepare: ssh_get_authentication_socket: No such file or directory
Why is this happening?