I was previously able to connect to my a server with ssh agent forwarding:
ssh -A my.server
And from there connect to another host on the server's network that had my public key in the
server:~# ssh another.host
This worked fine until I created a public/private key pair on the server,
Now when I try and connect I get:
Permission denied (publickey).
I believe what's happening is that the server's key
~/.ssh/id_rsa is being attempted and failing before the forwarded agent's key is being attempted.
There's probably way to turn up the number of allowed attempts on
my.server, but I was hoping there would be another configuration option to prioritize trying the key that is forwarded from the agent - similar to how
IdentityFile can be used to control which keys are tried for a particular server - or an option to disable the default
~/.ssh/id_rsa key from being attempted for a particular host - without having to rename it and specify it for all other hosts ( allowing it to remain a real default )
Also, I don't want to add the public key from
another.host - I only want that connection to happen when I'm logged into
my.server with agent forwarding.