SSH login using public key failed
listed in answer
ANSWER:
- Whenever encountering a problem ssh’ing to a server, it’s always best to add the ‘-v’ flag eg
ssh -v host -l user
-
In both above cases, the public key (id_rsa.pub) should be added to the “remote user’s .ssh/authorized_keys” file. In your case above, both to root and user1. This can easily be done via the ssh-copy-id command.
-
/var/log/secure will hold clues as to why the login was not successful.
-
Directory permissions should be 700 [rwx] (not 600) [rw-]

New Comments