Still getting a password prompt with ssh with public key authentication?

Zeeshan

I tried everything mentioned in this solution Why am I still getting a password prompt with ssh with public key authentication?, but still getting prompt for password.

My local log:

ssh -vvv srvFlink@remoteHost

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 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: /home/srvFlink/.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/srvFlink/.ssh/id_dsa
debug3: no such identity: /home/srvFlink/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/srvFlink/.ssh/id_ecdsa
debug3: no such identity: /home/srvFlink/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/srvFlink/.ssh/id_ed25519
debug3: no such identity: /home/srvFlink/.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
srvFlink@remoteHost's password:

Remote machine file permission:

drwx------.  2 srvFlink srvFlink   58 Aug 18 04:46 .ssh

-rw-------. 1 srvFlink srvFlink 1679 Aug 18 04:41 id_rsa
-rw-r--r--. 1 srvFlink srvFlink  406 Aug 18 04:41 id_rsa.pub
-rw-rw-r--. 1 srvFlink srvFlink  406 Aug 18 04:45 authorized_keys
drwx------. 2 srvFlink srvFlink   58 Aug 18 04:46 .
drwx------. 4 srvFlink srvFlink 4096 Aug 18 05:14 ..

In /etc/selinux/config file I have.

SELINUX=permissive
SELINUXTYPE=targeted

Content of id_rsa.pub of my local machine is there in the Remote machine ~/.ssh/authorized_keys

Content of /etc/ssh/sshd_config is same in both of the machine.

What might be the issue?

EDIT

Looks like file permission issue:

$ journalctl _COMM=sshd
Aug 18 06:54:53 localhost sshd[8891]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Aug 18 06:54:53 localhost sshd[8891]: Authentication refused: bad ownership or modes for file /home/srvFlink/.ssh/authorized_keys
Aug 18 06:54:56 localhost sshd[8891]: Connection closed by remotehost [preauth]
user4556274
-rw-rw-r--. 1 srvFlink srvFlink  406 Aug 18 04:45 authorized_keys

should be

-rw-r--r--. 1 srvFlink srvFlink  406 Aug 18 04:45 authorized_keys

as noted in the post you linked in your question, where the accepted answer reads in part "Your home directory ~, your ~/.ssh directory and the ~/.ssh/authorized_keys file on the remote machine must be writable only by you"

You also don't post the permissions on your home directory in the question; ensure that those are also not group- or other-writable.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Why am I still getting a password prompt with ssh with public key authentication?

From Dev

SSH public key added but still prompt for password

From Dev

SSH authentication by public key and password in the same time

From Dev

SSH - Key based authentication fails after password prompt

From Dev

ssh public key auth: first login still asks for a password

From Dev

SSH Public Key Authentication

From Dev

scripted ssh should not ask for a password if public key authentication fails

From Dev

Public key authentication and change of password

From Dev

ssh public key authentication not working

From Dev

ssh public key authentication not working

From Dev

SSH failed public key authentication

From Dev

ssh public key authentication fails

From Dev

Why does ssh -i still prompt for password?

From Dev

How can I rsync without prompt for password, without using public key authentication?

From Dev

ssh password authentication: use a graphical prompt?

From Dev

Added user as sudoer but still prompted for password after ssh key-based login authentication

From Dev

Why am I still being asked for an ssh password when I'm using private key authentication?

From Java

SSH Key - Still asking for password and passphrase

From Dev

ssh key exists on remote, but still prompts for password?

From Dev

ssh no longer allows public key authentication

From Dev

Server with ssh public key authentication with libssh

From Dev

ssh no longer allows public key authentication

From Dev

How to Debug Public Key SSH Authentication Failure

From Dev

Cannot SSH to Windows with public key authentication

From Dev

Setup SSH public key for login without password

From Dev

ssh-copy-id succeeded, but still prompt password input

From Dev

delay to get password prompt when ssh'ing to a public server

From Dev

Why is SSH key authentication better than password authentication?

From Dev

After adding public key to gitlab still cli want login and password

Related Related

  1. 1

    Why am I still getting a password prompt with ssh with public key authentication?

  2. 2

    SSH public key added but still prompt for password

  3. 3

    SSH authentication by public key and password in the same time

  4. 4

    SSH - Key based authentication fails after password prompt

  5. 5

    ssh public key auth: first login still asks for a password

  6. 6

    SSH Public Key Authentication

  7. 7

    scripted ssh should not ask for a password if public key authentication fails

  8. 8

    Public key authentication and change of password

  9. 9

    ssh public key authentication not working

  10. 10

    ssh public key authentication not working

  11. 11

    SSH failed public key authentication

  12. 12

    ssh public key authentication fails

  13. 13

    Why does ssh -i still prompt for password?

  14. 14

    How can I rsync without prompt for password, without using public key authentication?

  15. 15

    ssh password authentication: use a graphical prompt?

  16. 16

    Added user as sudoer but still prompted for password after ssh key-based login authentication

  17. 17

    Why am I still being asked for an ssh password when I'm using private key authentication?

  18. 18

    SSH Key - Still asking for password and passphrase

  19. 19

    ssh key exists on remote, but still prompts for password?

  20. 20

    ssh no longer allows public key authentication

  21. 21

    Server with ssh public key authentication with libssh

  22. 22

    ssh no longer allows public key authentication

  23. 23

    How to Debug Public Key SSH Authentication Failure

  24. 24

    Cannot SSH to Windows with public key authentication

  25. 25

    Setup SSH public key for login without password

  26. 26

    ssh-copy-id succeeded, but still prompt password input

  27. 27

    delay to get password prompt when ssh'ing to a public server

  28. 28

    Why is SSH key authentication better than password authentication?

  29. 29

    After adding public key to gitlab still cli want login and password

HotTag

Archive