On a ubuntu 16.04 server (OVH public cloud)
I create a standard account :
adduser www I add my public key into .ssh/authorized_keys Then I do a
ssh www@myserver And I got :
Please login as the user "ubuntu" rather than the user "root" I was expecting "www" instead of "root", but not : strange.
The public key is correctly read because before setting it I got permission denied. In fact, the login process begins correctly because in auth.log I got :
May 14 09:12:42 serveur-1 sshd[16069]: Accepted publickey for www from 86.252.248.254 port 38686 ssh2: RSA SHA256:+X9bylqQgjb/bjeLL8P0AVx0WFJZloWXacKPE43oD4E May 14 09:12:42 serveur-1 sshd[16069]: pam_unix(sshd:session): session opened for user www by (uid=0) May 14 09:12:42 serveur-1 systemd: pam_unix(systemd-user:session): session opened for user www by (uid=0) May 14 09:12:42 serveur-1 systemd-logind[1291]: New session 27 of user www. May 14 09:12:52 serveur-1 sshd[16129]: Received disconnect from 86.252.248.254 port 38686:11: disconnected by user May 14 09:12:52 serveur-1 sshd[16129]: Disconnected from 86.252.248.254 port 38686 May 14 09:12:52 serveur-1 sshd[16069]: pam_unix(sshd:session): session closed for user www May 14 09:12:52 serveur-1 systemd-logind[1291]: Removed session 27. I know, I should do a ssh ubuntu@myserver and then use sudo, but I want to understand why I have this behaviour and how can I disable it to be able to log in a standard account directly with ssh
Any idea ?
/etc/passwd.