I'd like to login remotely to the SSH server on my Slackware. I can login as a non-root user for e.g. mark but can't login just as root. When I type a root password I get the message "Authentication Failure". In my /etc/ssh/sshd_config file I have the following options enabled:

PermitRootLogin yes
PasswordAuthentication yes

What can I do to login just as root user?

  • Could you try an ssh with -vvv switch? This will print detailed steps of the remote session and you will see where/why it fails.
    – 13dimitar
    Jan 8, 2017 at 12:25
  • Do you connect with -l root? Jan 8, 2017 at 13:03
  • Have you restarted sshd after editing the config file? service sshd restart Jan 8, 2017 at 15:44
  • 1
    Take a look at the reason looking through the /var/log/auth.log sshd log file (if you're on Ubuntu, for example). Maybe It's just a wrong key enabled or a misconfiguration of modes. If you copy-paste some lines of log related to your attempt connecting using root we can help you.
    – Echoes_86
    Jan 8, 2017 at 16:01
  • Does your root user even have a password? Or are you normally using a pure sudo system?
    – Daniel B
    Jan 9, 2017 at 22:36

1 Answer 1


Couple of things you can try checking. The /etc/passwd file to check if a shell was set as well as check the root user .profile and .bashrc files may have something in there preventing you from logging in.

@Burgi. The /etc/passwd file would have the shell that the user logs in as. Typically you would have /bin/bash or some other relevant shell. Once the user logins that shell environment in the passwd file associated with it will be executed and user session runs with that shell. However, if there was no valid shell, then the user would not be able to login as there no valid shell environment to login as. There is also /sbin/nologin as well which "displays a message that an account is not available and exits non-zero. It is intended as a replacement shell field to deny login access to an account." man nologin for more details. You can also use /bin/false to get a similar effect. Check Chroot for SFTP.

With the .profile and .bashrc files there are executable so if had logout for example in those files it would cause the user to logout. Since this happens at the login it would appear as though the user is not logging in.

Hope this was useful.

  • Can you go into a little more detail on how this will work?
    – Burgi
    Jan 10, 2017 at 17:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.