K
K
Konstantin Rudenkov2017-08-17 14:53:29
SSH
Konstantin Rudenkov, 2017-08-17 14:53:29

What am I doing wrong when ssh connecting with keys?

Wem hello. I have a strange problem and do not really understand where to dig.
Part 1 - working

ssh [email protected]_server
jenkins# su - jenkins
jenkins# ssh [email protected]
serverA#

Part 2 - working
ssh [email protected]_server
jenkins# su - jenkins
jenkins# ssh [email protected]
serverB#

Part 3 - not working
ssh [email protected]_server
jenkins# su - jenkins
jenkins# ssh serverA
serverA# ssh [email protected]
need password:

while getting the following log on serverA:
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /root/.ssh/id_dsa
debug3: no such identity: /root/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ecdsa
debug3: no such identity: /root/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /root/.ssh/id_ed25519
debug3: no such identity: /root/.ssh/id_ed25519: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
[email protected]'s password:

serverA# ls -lah /root/.ssh/
drwx------ 2 root root 4.0K Aug 15 14:58 .
drwx------ 9 root root 4.0K Aug 17 06:25 ..
-rw------- 1 root root 7.8K Aug 15 14:58 authorized_keys
-rw-r--r-- 1 root root  139 Jul  3 17:55 config
-rw------- 1 root root  392 Jul  3 17:55 id_rsa
-rw-r--r-- 1 root root 1.1K Aug 17 14:03 known_hosts

Working option
ssh [email protected]
serverA# ssh [email protected]

I tried ssh in different versions with the -a key to run, no effect. Accordingly, the keys are scattered everywhere.
PS I didn't bother with the line prompt (#/$), don't hit me strictly.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question