Can only login with root user on centOS

#1

Hi

I have provisioned a new instance running centos 7. It works fine but I can only use ssh with the root user, not any additional users. I am using ssh keys.

A log can be seen below. Can anyone point to what I am missing? Normally when deploying debian instances I dont need to do anything special to have normal users login. I cant find anything that seems relevant on google.

linaro@house02:~$ ssh root@51.158.xxx.xxx
Last login: Sun May 3 09:14:22 2020 from xyz
[root@ams-02 ~]# su - m
Last login: Sun May 3 09:55:11 UTC 2020 on pts/0
[m@ams-02 ~]$ exit
logout
[root@ams-02 ~]# exit
logout
Connection to 51.158.xxx.xxx closed.
linaro@house02:~$ ssh m@51.158.xxx.xxx
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

#2

Make sure you added your SSH public key to the ~/.ssh/auhtorized_keys of that user :slight_smile:

#3

Yes, I had forgotten that at first, so I copied the contents of the file from the root user.

But it seems related:

ssh -v says:

debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Unspecified GSS failure. Minor code may provide more information
No Kerberos credentials available (default cache: FILE:/tmp/krb5cc_1000)

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/linaro/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic
debug1: Trying private key: /home/linaro/.ssh/id_dsa
debug1: Trying private key: /home/linaro/.ssh/id_ecdsa
debug1: Trying private key: /home/linaro/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).