2

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 ?

1
  • 2
    Could you share string for wee user from your /etc/passwd. Commented May 14, 2017 at 22:51

1 Answer 1

1

I found the real resaon : I copied my authorized_keys from root to the standard account, there was :

no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="echo 'Please login as the user \"centos\" rather than the user \"root\".';echo;sleep 10" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2WA6Iao6j6yLs

In it.

So come the message...

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.