I am ssh'ing to a CentOS 7.2 server using public key authentication (from a Mac OS X bash session). I can successfully ssh using the centos user to the remote box, using the PEM key I have with the -i argument when specifying centos@remotehost.

I would like to ssh with another user that exists on the remote host. I don't see any AllowUser or DenyUser rules in the sshd_config on the remote host. When I run ssh -i mykey.pem -v auser@remotehost I get Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Both users exist in /etc/passwd on the remote host. I don't understand why only the centos user can successfully ssh. In /var/log/secure on the remote host I see localhost sshd[19206]: error: AuthorizedKeysCommand /usr/bin/sss_ssh_authorizedkeys returned status 1.

The thing is, I see that same message for successful logins as well, in which case it's followed by Accepted publickey for centos . . .

Any ideas?

  • 1
    How did you configure authorized_keys for the auser on the remote host?
    – Jakuje
    Sep 26 '16 at 8:13

I accepted an answer here, it looks like it was deleted. auser had a home directory had a mode that ssh didn't like (because the home directory also contains the .ssh directory). When I changed the mode to 700 the connection with auser worked as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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