I was previously able to connect to my a server with ssh agent forwarding:ssh -A my.serverAnd from there connect to another host on the server's network that had my public key in the authorized_keys file:server:~# ssh another.hostThis worked fine until I created a public/private key pair on the server, ~/.ssh/id_rsa and ~/.ssh/id_rsa.pubNow 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 IdentitiesOnly 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 my.server to another.host - I only want that connection to happen when I'm logged into my.server with agent forwarding.
How can I prioritize a ssh Forwarded Agent over an Identity File?
ssh;authentication;ssh agent