Can't login to a remote machine with key

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.


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),

Tags:

Ssh

Openssh

Sshd