2

I know this issue has been discussed already. I looked at the other threads, and didn't find a question with the same issue, hope you could help me...

I SSH from userA@hostA to userB@hostB. Both hosts using the same file-system, meaning that userA's home is the same on hostA and hostB, and the same with userB's home.

Now, I wanted to save the key on B's .ssh dir, so I could access from A@A to B@B without a password, so I did the following on userA@hostA:

ssh-keygen -t rsa -b 2048
ssh-copy-id -i ~/.ssh/id_rsa userB@hostB
echo $? ### output was 0, meaning it was successfull    
ssh -v userB@hostB   

And got the following output:

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to hostB [100.100.100.100] port 22.
debug1: Connection established.
debug1: identity file /home/userA/.ssh/identity type -1
debug1: identity file /home/userA/.ssh/identity-cert type -1
debug1: identity file /home/userA/.ssh/id_rsa type 1
debug1: identity file /home/userA/.ssh/id_rsa-cert type -1
debug1: identity file /home/userA/.ssh/id_dsa type -1
debug1: identity file /home/userA/.ssh/id_dsa-cert type -1
debug1: identity file /home/userA/.ssh/id_ecdsa type -1
debug1: identity file /home/userA/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'hostB' is known and matches the RSA host key.
debug1: Found key in /home/userA/.ssh/known_hosts:3
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Unspecified GSS failure.  Minor code may provide more information


debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_524' not found

debug1: Next authentication method: publickey
debug1: Trying private key: /home/userA/.ssh/identity
debug1: Offering public key: /home/userA/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/userA/.ssh/id_dsa
debug1: Trying private key: /home/userA/.ssh/id_ecdsa
debug1: Next authentication method: password
userB@hostB's password:

Note that I did manage to have a password-free access to userA@hostB, but not when accessing userB...

Any ideas?

Thanks a lot!

PS. some additional info:

hostA version:

Linux version 2.6.32-573.7.1.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Tue Sep 22 22:00:00 UTC 2015

hostB version:

Linux version 2.6.32-358.el6.x86_64 (mockbuild@x86-022.build.eng.bos.redhat.com) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Tue Jan 29 11:47:41 EST 2013

on userB@hostB (I assume that's what Jakuje meant), access of dirs and files:

~: drwxrwx---  
~/.ssh: drwx------  
~/.ssh/authorized_keys: -rw-------
  • 2
    first of all, check the server log (if you have access to it). Then update your question with the information what distro are you using on hostA and hostB. Also update the question with information about the permissions on your ~, ~/.ssh and ~/.ssh/authorized_keys on server: ls -l ~ ~/.ssh ~/.ssh/authorized_keys. – Jakuje Feb 21 '16 at 11:20
  • sh-copy-id -i ~/.ssh/id_rsa ... Did you mean -i ~/.ssh/id_rsa.pub? Newer versions add the .pub automatically, but you're on an old version. – muru Feb 22 '16 at 13:37
  • @muru - By mistake, I forgot the .pub (I have both files). I tried now with the .pub extension, but no change, it still asks for PW on every su :( – Hagai Naveh Feb 23 '16 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.