11

I try to log in with PuTTY as root, but when I type in the password it says access denied.

Can someone please help me fix this?

  • 1
    What have you tried? Did you verify you're connecting to the correct host? Is e password correct, or did you e.g. Change keyboard layouts? Can you log in using other users? Is SSH root login enabled or disabled? – Daniel Beck Jan 20 '13 at 22:51
  • As an addition to @DanielBeck's questions: Is root login enabled on the server? What's the /etc/ssh/sshd_config look like? – nerdwaller Jan 20 '13 at 23:05
24

There are only four potential problem I can think of (most of which have been covered already):

  • You're not connecting to the right server.

    • If you're using an IP address, check it.

    • If you're using a host name, verify that it's pointing to the right IP address and/or try the IP address instead.

  • You're not entering the right username.

    • The fact that you have root access doesn't mean you can actually log in as root. It only means that you have an account with root privileges (normally via sudo).

    • If you're not entering the username manually, make sure Connection → Data → Auto-login username is actually set to root.

  • You're not entering the right password.

    • Check the password you're entering.

    • Verify that CapsLock is disabled.

    • Verify that PuTTY uses the proper keyboard layout.

    • If you use AltGr, make sure Terminal → Keyboard → AltGr acts as Comopse key isn't checked.

    • If none of the above works, clear the field Connection → Data → Auto-login username (assuming it is set) and enter the password in the username field to verify it gets entered correctly.

  • Root access is disabled.

    Some SSH servers can disable SSH logins for certain users and may even disable root logins by default.

    If you're using Open SSH server, you have to edit /etc/ssh/sshd_config and make sure that it doesn't contain one of the following lines:

    PermitRootLogin no
    PermitRootLogin without-password
    

    Both result in a simple Access denied. error, although they permit you to enter the password. The latter only allows root logins when authenticating using public keys.

    To permit root logins, remove the corresponding line or replace it with the following:

    PermitRootLogin yes
    

    See man sshd_config for further information.

| improve this answer | |
  • The root access was disabled for me, great answer! – Burgi Jul 11 '16 at 10:21
  • 1
    The 4th option worked for me as well. My /etc/ssh/sshd_config file did not contain either of the two lines that were mentioned, however I added the PermitRootLogin yes line to my file anyways and it worked. Make sure you restart your SSH service after making any modifications to that file (service ssh restart), so that they take effect. – Steph Sep 17 '17 at 19:52
0

For me it was fail2ban that I had installed.

Solution: edit /etc/fail2ban/jail.local

The line with the entry ignoreip = must be edited. Put your IP / CIDR / DNS name in the box and the login should be possible again.

| improve this answer | |

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