Broken SSH to recover

fefe asked:

I’ve been messing up my ssh as trying to add a new user. Now I can not access server Via ssh I have access to Parallel is there a hope to recover ssh connection?

ssh -v -v -v root@mydomm.com

drops

Authentications that can continue: publickey,password
Permission denied, please try again.

History before disaster

useradd myname
passwd myname

than edited

/etc/ssh/sshd_config

added

AllowUsers myname

restarted

service ssh restart

after all of this exit
and trying to log in but even root is not working now

Making a bit of research after recovery how to add a new ssh users I found it that doesn’t needs any editing /etc/ssh/sshd_config just simply add a new user adduser youusername and reload ssh service ssh reload

My answer:


You set AllowUsers myname in your configuration. This means that only myname can log in to the server with ssh. Not even root can log in since it is not named in AllowUsers.

To resolve the issue, login and fix or remove the AllowUsers directive.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.