15

I used to login to a remote machine( I have to root of this machine) using key. Both my local machine and remote machine is in f23. From last few days, I can't login to this machine using key. It is asking for password. Here is the ssh -vvv:

ssh -vvv aveta
OpenSSH_7.1p1, OpenSSL 1.0.2d-fips 9 Jul 2015
debug1: Reading configuration data /home/rudra/.ssh/config
debug1: /home/rudra/.ssh/config line 4: Applying options for aveta
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to phy-aveta.physics.uu.se [130.238.194.143] port 22.
debug1: Connection established.
debug1: identity file /home/rudra/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.1
debug1: match: OpenSSH_7.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to phy-aveta.physics.uu.se:22 as 'rudra'
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from phy-aveta.physics.uu.se
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,ssh-rsa
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: kex: [email protected] need=64 dh_need=64
debug1: kex: [email protected] need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:F34tt6QLRDt6Qm45eHOFhYGS5DSxYrThhR2lbBHNXes
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from phy-aveta.physics.uu.se
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:14
debug3: load_hostkeys: loaded 1 keys from 130.238.194.143
debug1: Host 'phy-aveta.physics.uu.se' is known and matches the ECDSA host key.
debug1: Found key in /home/rudra/.ssh/known_hosts:16
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/rudra/.ssh/id_rsa (0x562e17c87070),
debug2: key: /home/rudra/.ssh/id_dsa ((nil)),
debug2: key: /home/rudra/.ssh/id_ecdsa ((nil)),
debug2: key: /home/rudra/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

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


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug2: we did not send a packet, disable method
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: /home/rudra/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/rudra/.ssh/id_dsa
debug3: no such identity: /home/rudra/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/rudra/.ssh/id_ecdsa
debug3: no such identity: /home/rudra/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/rudra/.ssh/id_ed25519
debug3: no such identity: /home/rudra/.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: 

I have deleted .ssh, .config and .cache from the remote and redo ssh-copy-id, without any help.

To troubleshoot, I have createed another user, did ssh-copy-id and that one is working fine. ssh -vvv for that working machine is:

ssh -vvv [email protected] 
OpenSSH_7.1p1, OpenSSL 1.0.2d-fips 9 Jul 2015
debug1: Reading configuration data /home/rudra/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to phy-aveta.physics.uu.se [130.238.194.143] port 22.
debug1: Connection established.
debug1: identity file /home/rudra/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rudra/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.1
debug1: match: OpenSSH_7.1 pat OpenSSH* compat 0x04000000
debug2: fd 3 setting O_NONBLOCK
debug1: Authenticating to phy-aveta.physics.uu.se:22 as 'rudra2'
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from phy-aveta.physics.uu.se
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],ssh-ed25519,ssh-rsa
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
debug2: kex_parse_kexinit: ssh-rsa,ecdsa-sha2-nistp256,ssh-ed25519
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected]
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug1: kex: server->client [email protected] <implicit> none
debug1: kex: client->server [email protected] <implicit> none
debug1: kex: [email protected] need=64 dh_need=64
debug1: kex: [email protected] need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:F34tt6QLRDt6Qm45eHOFhYGS5DSxYrThhR2lbBHNXes
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:16
debug3: load_hostkeys: loaded 1 keys from phy-aveta.physics.uu.se
debug3: hostkeys_foreach: reading file "/home/rudra/.ssh/known_hosts"
debug3: record_hostkey: found key type ECDSA in file /home/rudra/.ssh/known_hosts:14
debug3: load_hostkeys: loaded 1 keys from 130.238.194.143
debug1: Host 'phy-aveta.physics.uu.se' is known and matches the ECDSA host key.
debug1: Found key in /home/rudra/.ssh/known_hosts:16
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/rudra/.ssh/id_rsa (0x55c98f7eb080),
debug2: key: /home/rudra/.ssh/id_dsa ((nil)),
debug2: key: /home/rudra/.ssh/id_ecdsa ((nil)),
debug2: key: /home/rudra/.ssh/id_ed25519 ((nil)),
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

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


debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available

debug2: we did not send a packet, disable method
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: /home/rudra/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp SHA256:xT3VPQUunB3Nv/Pmi6C6Sroc0fa9SlKcQ4d0eF2vxzI
debug3: sign_and_send_pubkey: RSA SHA256:xT3VPQUunB3Nv/Pmi6C6Sroc0fa9SlKcQ4d0eF2vxzI
debug1: Authentication succeeded (publickey).
Authenticated to phy-aveta.physics.uu.se ([130.238.194.143]:22).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug3: ssh_packet_set_tos: set IP_TOS 0x10
debug2: client_session2_setup: id 0
debug2: channel 0: request pty-req confirm 1
debug1: Sending environment.
debug3: Ignored env XDG_VTNR
debug3: Ignored env XDG_SESSION_ID
debug3: Ignored env HOSTNAME
debug3: Ignored env SHELL
debug3: Ignored env TERM
debug3: Ignored env XDG_MENU_PREFIX
debug3: Ignored env VTE_VERSION
debug3: Ignored env HISTSIZE
debug3: Ignored env XCRYSDEN_SCRATCH
debug3: Ignored env WINDOWID
debug3: Ignored env QTDIR
debug3: Ignored env QTINC
debug3: Ignored env QT_GRAPHICSSYSTEM_CHECKED
debug3: Ignored env XCRYSDEN_TOPDIR
debug3: Ignored env USER
debug3: Ignored env LS_COLORS
debug3: Ignored env DESKTOP_AUTOSTART_ID
debug3: Ignored env SSH_AUTH_SOCK
debug3: Ignored env SESSION_MANAGER
debug3: Ignored env PATH
debug3: Ignored env MAIL
debug3: Ignored env DESKTOP_SESSION
debug3: Ignored env QT_IM_MODULE
debug3: Ignored env XDG_SESSION_TYPE
debug3: Ignored env PWD
debug1: Sending env XMODIFIERS = @im=ibus
debug2: channel 0: request env confirm 0
debug1: Sending env LANG = en_GB.UTF-8
debug2: channel 0: request env confirm 0
debug3: Ignored env MODULEPATH
debug3: Ignored env GDM_LANG
debug3: Ignored env LOADEDMODULES
debug3: Ignored env GDMSESSION
debug3: Ignored env SSH_ASKPASS
debug3: Ignored env HISTCONTROL
debug3: Ignored env HOME
debug3: Ignored env XDG_SEAT
debug3: Ignored env SHLVL
debug3: Ignored env GNOME_DESKTOP_SESSION_ID
debug3: Ignored env XBANDPATH
debug3: Ignored env XDG_SESSION_DESKTOP
debug3: Ignored env LOGNAME
debug3: Ignored env QTLIB
debug3: Ignored env DBUS_SESSION_BUS_ADDRESS
debug3: Ignored env MODULESHOME
debug3: Ignored env LESSOPEN
debug3: Ignored env WINDOWPATH
debug3: Ignored env XDG_RUNTIME_DIR
debug3: Ignored env DISPLAY
debug3: Ignored env XDG_CURRENT_DESKTOP
debug3: Ignored env XAUTHORITY
debug3: Ignored env BASH_FUNC_module()
debug3: Ignored env BASH_FUNC_scl()
debug3: Ignored env _
debug2: channel 0: request shell confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel_input_status_confirm: type 99 id 0
debug2: PTY allocation request accepted on channel 0
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last login: Mon Oct 12 12:33:15 2015 from 130.238.194.90
[rudra2@phy-aveta ~]$ debug2: client_check_window_change: changed
debug2: channel 0: request window-change confirm 0

I am clueless why in same local-remote combination, one is working and other is not.

EDIT .ssh/config for the failed one is:

Host aveta
  User rudra
  Hostname phy-aveta.physics.uu.se
  ForwardX11 yes

There is no ssh/.config entry for rudra2, i.e. that worked.

Ans to Paul in my local machine I have:

tree .ssh/
.ssh/
├── authorized_keys
├── config
├── environment
├── id_rsa
├── id_rsa.pub
└── known_hosts

In both the remote user, I only have authorized_keys. And both are identical.

[root@phy-aveta rudra2]# diff .ssh/authorized_keys /home/rudra/.ssh/authorized_keys 
[root@phy-aveta rudra2]# 

Edit 2: Without using ssh/.configI have commented out the part for first user in .ssh/config. http://ur1.ca/nzndx is the ssh -vvv for that. It is still asking for password

Edit: Permission The first user...failed one

#ls -al /home/rudra/|grep .ssh
drwx------.  2 rudra rudra  4096 Oct 12 14:16 .ssh
$ls -alF .ssh/
total 12K
drwx------.  2 rudra rudra 4.0K Oct 12 14:16 ./
drwxrwxr-x. 36 rudra rudra 4.0K Oct 12 14:30 ../
-rw-------.  1 rudra rudra  394 Oct 10 12:01 authorized_keys

For 2nd user

# ls -al /home/rudra2/|grep .ssh
drwx------. 2 rudra2 rudra2 4096 Oct 12 14:16 .ssh
$ ls -alF .ssh/
total 12
drwx------. 2 rudra2 rudra2 4096 Oct 12 14:16 ./
drwx------. 4 rudra2 rudra2 4096 Oct 12 14:14 ../
-rw-------. 1 rudra2 rudra2  394 Oct 11 09:57 authorized_keys
7
  • What's (the relevant part of) your local ~/.ssh/config? Oct 12, 2015 at 11:53
  • The most obvious difference is that for the first user, ssh is applying options from /home/rudra/.ssh/config, while for the second user, it doesn't. So … show us those options? Oct 12, 2015 at 12:05
  • 2
    Possible duplicate of How to make password-less login work Oct 12, 2015 at 23:27
  • 2
    I'm voting to keep this question open, because it does two things, 1) some of the answers help the user read the diagnostics that the verbose flags generate, and 2) shows that the incorrect permissions aren't directly shown in the diagnostics, even though are the basis of the problem.
    – X Tian
    Oct 13, 2015 at 8:00
  • 1
    This problem is different from "How to make password-less login work" because of the nature of the issue and its symptoms. Admins are constantly salivating to mark stuff as duplicates. Have a little patience.
    – Br.Bill
    Nov 10, 2016 at 21:47

2 Answers 2

15

There it is. Group has write access to ~rudra:

$ls -alF .ssh/ total 12K
drwx------.  2 rudra rudra 4.0K Oct 12 14:16 ./
drwxrwxr-x. 36 rudra rudra 4.0K Oct 12 14:30 ../
-rw-------.  1 rudra rudra  394 Oct 10 12:01 authorized_keys

Thus, sshd refuses to trust the files in ~rudra, and does not use ~rudra/.ssh/authorized_keys, even though its permissions are correct.

chmod g-w ~rudra ought to fix it.

2
  • 1
    Oh...I always do ll to check permission to see that, hence never noticed it. Actually I dont know why ../ dir appears. But changing the permission fixed it.
    – BaRud
    Oct 12, 2015 at 12:58
  • 3
    That would be the -a option to ls – and why I asked for ls -alF specifically. … okay, so the -F is superfluous here; just old habit. ;-) Oct 12, 2015 at 13:00
5

Your first user submits the rsa key and it's rejected.

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/rudra/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password

Your second user succeeds

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/rudra/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug2: input_userauth_pk_ok: fp SHA256:xT3VPQUunB3Nv/Pmi6C6Sroc0fa9SlKcQ4d0eF2vxzI
debug3: sign_and_send_pubkey: RSA SHA256:xT3VPQUunB3Nv/Pmi6C6Sroc0fa9SlKcQ4d0eF2vxzI
debug1: Authentication succeeded (publickey).

Your command lines are different and your local .ssh/config is being activated for the first user for remote host aveta:

debug1: Reading configuration data /home/rudra/.ssh/config
debug1: /home/rudra/.ssh/config line 4: Applying options for aveta
debug1: Reading configuration data /etc/ssh/ssh_config

What options are you using in the config file ?

Lastly the two rsakeys used appear to be different.

First user

debug2: key: /home/rudra/.ssh/id_rsa (0x562e17c87070),

Second user

debug2: key: /home/rudra/.ssh/id_rsa (0x55c98f7eb080),
1
  • @X Tian: Any clue why the publey is rejected? I have never seen ecdsa file in .ssh
    – BaRud
    Oct 12, 2015 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .