0

This question already has an answer here:

So I have a centos 7 server with 2 users.

User1 has the ~/.ssh/authorized_keys file with proper permissions and with externaluser's public key in it.

User2 has the ~/.ssh/authorized_keys file with proper permissions and with the same externaluser's public key in it.

Externaluser can ssh to User1 with no problems, however, he gets Permission denied (publickey,gssapi-keyex,gssapi-with-mic) error when trying to ssh to User2.

Why does this happen? It's literally the same public key, properly pasted into the authorized_keys file of each user, using the same method.

marked as duplicate by roaima, user88036, Jeff Schaller, Thomas, Isaac Oct 11 '18 at 7:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

Thank you RalfFriedl for your useful comment, the problem was the .ssh folder permissions.

Check the owner and permissions on .ssh and on authorized_keys.

Not the answer you're looking for? Browse other questions tagged or ask your own question.