This thread is a response to the titled question : Why ssh-agent doesn't forward my SSH certificate ? Actually I couldn't find any information during my search. I had to read the C code of ssh-add to resolve my issue..
Problem
I got a valid SSH Certificate :
$ ssh-keygen -L -f ~/.ssh/id_rsa-cert.pub
/home/user/.ssh/id_rsa-cert.pub:
Type: [email protected] user certificate
Public key: RSA-CERT SHA256:YgFzKPkUdZHLLi8bEKUs5/hLumNoMNG+oDJ+KD6mS3s
Signing CA: RSA SHA256:w+Cjpu/QQUunuojs9Af82ENdBUreCDXo+APao9X4dHw
Key ID: "user_key"
Serial: 0
Valid: from 2017-12-06T10:53:00 to 2017-12-07T10:54:57
Principals:
user
admin
Critical Options: (none)
Extensions:
permit-X11-forwarding
permit-agent-forwarding
permit-port-forwarding
permit-pty
permit-user-rc
This is my ssh-agent list of keys :
$ ssh-add -l
4096 SHA256:YgFzKPkUdAGBPi8bEKUs5/hLumNoAds+oDJ+KD6mS3s user_key (RSA)
When I SSH on a remote server, it works. I have no ~/.ssh/authorized_keys
and my key is probably well forwarded because I got the same previous result.
Now I would like to SSH to another server from the first one (with ForwardAgent yes
):
$ ssh srv1
srv1:~$ ssh srv2 -vvv
...
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: user_key
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
srv1:~$
What did I do wrong ?