3

I'm trying to SSH to my Debian 8.5 using root user. The password is correct because I can login to Debian using local console. PermitRootLogin is equal to yes in /etc/ssh/sshd_config and server is restarted multiple time to insure that this change is taken.

grep PermitRootLogin /etc/ssh/sshd_config
PermitRootLogin yes

How can i solve this problem?

Running sudo tail /var/log/auth.log:

Nov 29 07:40:06 mydeb sshd[2530]: User root from ::1 not allowed because none of user's groups are listed in AllowGroups
Nov 29 07:40:06 mydeb sshd[2530]: input_userauth_request: invalid user root [preauth]
Nov 29 07:40:07 mydeb sshd[2530]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=::1  user=root
Nov 29 07:40:09 mydeb sshd[2530]: Failed password for invalid user root from ::1 port 41079 ssh2
Nov 29 07:40:14 mydeb sshd[2530]: Failed password for invalid user root from ::1 port 41079 ssh2
Nov 29 07:40:16 mydeb sshd[2530]: Failed password for invalid user root from ::1 port 41079 ssh2
Nov 29 07:40:16 mydeb sshd[2530]: Connection closed by ::1 [preauth]
Nov 29 07:40:16 mydeb sshd[2530]: PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=::1  user=root
  • what do the server logs say? – Jakuje Nov 28 '16 at 22:10
  • You means syslog? – deadhacker1900 Nov 28 '16 at 22:12
  • Add output of sudo tail /var/log/auth.log – SuB Nov 28 '16 at 22:12
  • Assign password of root user by command sudo passwd root. – Mikhail Khirgiy Nov 29 '16 at 5:32
  • 1
    As i said in my question: The password is correct because I can login to Debian using local console. – deadhacker1900 Nov 29 '16 at 17:20
5

Edit /etc/ssh/sshd_config and add root at the of line which is started with AllowGroups. The line should be like this:

AllowGroups sudo sshuser root

Restart ssh service by following command:

service ssh restart

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.