I searched on existing documents but nothing achieved.
From my laptop, I have to ssh to server A and from there I have to ssh again to have access to server B.
I tried below:
#ssh-add
#ssh -A username@serverA
then
#ssh username@serverB --> Permission denied (publickey).
again, from my laptop, I copied my id.rsa
(private key) to serverA and from there ssh to serverB, while nothing happened too.
A brief output of ssh from serverA to serverB:
debug1: ssh_ecdsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS
sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS
received debug1: Roaming not allowed by server debug1:
SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey debug1: Next
authentication method: publickey debug1: Offering RSA public key:
/home/moji/.ssh/id_rsa debug1: Authentications that can continue:
publickey debug1: Offering RSA public key: M.Taleghani debug1:
Authentications that can continue: publickey debug1: Trying private
key: /home/mojtaba/.ssh/id_rsa debug1: Trying private key:
/home/mojtaba/.ssh/id_dsa debug1: Trying private key:
/home/mojtaba/.ssh/id_ecdsa debug1: Trying private key:
/home/mojtaba/.ssh/id_ed25519 debug1: No more authentication methods
to try. Permission denied (publickey).
id.rsa
and not your laptop one.echo "${HOSTNAME:-"$(hostname)"}: $SSH_AUTH_SOCK"; ssh-add -l; ssh -vA username@serverA sh -c 'echo "${HOSTNAME:-"$(hostname)"}: $SSH_AUTH_SOCK"; ssh-add -l; ssh -v username@serverB'
? Thanks.