I had the same issue.
In my environment I had two accounts (acct1 and acct2)
I set up my ssh keys in acct1 and it worked properly.
Then I copied the .ssh directory from acct1 to acct2 and tried it there, but it didn't work as expected, asked me for the password...
The reason was:
The ownership of the files in .ssh directory. The acct2 user was not the owner of those files.
-rw------- 1 root root 408 Aug 10 16:53 id_rsa.pub
-rw------- 1 **root** **root** 1675 Aug 10 16:53 id_rsa
-rw-r--r-- 1 acct2 acct2 444 Aug 10 16:54 known_hosts
So I just changed the ownership of files to acct2 user.
sudo chown acct2:acct2
Now it look like below and it works properly.
-rw------- 1 acct2 acct2 408 Aug 10 16:53 id_rsa.pub
-rw------- 1 **acct2** **acct2** 1675 Aug 10 16:53 id_rsa
-rw-r--r-- 1 acct2 acct2 444 Aug 10 16:54 known_hosts
known_hosts
file is for the purpose of the connector in making sure the server they're connecting to is correct. This shouldn't influence what authentication method is used by the server.ssh-copy-id
?/var/log/auth.log
? Do you see error/warning related to SSH ?