How to Allow root to use SSH on Ubuntu 14.04

Ubuntu is Debian-based distributions that don’t allow logins by the root user by default, either locally or remotely via SSH. Previous post, i have discussed how to enable root login on Ubuntu 14.04 by issue the following command :

sudo passwd root

Above command not allow the root user to remotely use SSH connection by default. There are a few more steps need to perform in order to allow root to use SSH on Ubuntu 14.04. Kindly follow below steps :

1. Login using normal user and su to root. Edit /etc/ssh/sshd_config :

ehowstuff@ubuntu14:~$ su - root
Password:
root@ubuntu14:~# vi /etc/ssh/sshd_config

2. Comment out #PermitRootLogin without-password, add PermitRootLogin yes into the line :

# Authentication:
LoginGraceTime 120
#PermitRootLogin without-password
PermitRootLogin yes
StrictModes yes

3. Restart ssh service to take affect the changes :

root@ubuntu14:~# service sshd restart
ssh stop/waiting
ssh start/running, process 1499
root@ubuntu14:~#

4. That’s all.

3 comments
  1. GiGiRock
    GiGiRock
    May 12, 2014 at 11:07 pm

    I’m sorry , but this obvious method doesn’t work.
    No way to login as root from putty or other ssh client

    Reply
    • Dean
      Dean
      May 18, 2014 at 10:32 pm

      Clearly you are a dumb-ass then because it does and there is

      Reply
  2. God
    God
    June 19, 2014 at 2:57 pm

    Ubuntu 14.04 has ssh bug, it may still failed to allow root login by simply run “service ssh restart”. But reboot the OS will make it work. Saying others dumb-ass is not polite even if you are the most smart in the universe.

    Reply
Leave a Reply

Your email address will not be published. Required fields are marked *

SiteGround.com

A world leading hosting company that provides fully-managed innovative and secure solutions, suitable for hosting small to medium-sized websites

Built on the best available technologies combined with Google Cloud for strong redundancy and application availability. Backed by skilled experts to address web security threats, a devops team to create advanced custom security solutions, and 24/7 sysadmins to watch over the platform. This powerful, hands-on approach makes your sites faster, safer, and easier to manage. Starting from only $3.95/mo.

TRY FREE

* up to 30 days money back guarantee