0

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).
3
  • I read it before. the problem exist yet
    – Moji
    Sep 18, 2018 at 8:28
  • Your procedure's not really clear , but I think you shoud copy to ServerB the ServerA id.rsa and not your laptop one. Sep 18, 2018 at 8:48
  • Could you please edit your question to include the output of 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. Sep 18, 2018 at 10:26

0

You must log in to answer this question.

Browse other questions tagged .