145

I´d like to enable the ssh root access on Ubuntu 14.04. Editing the /etc/ssh_config (PermitRootLogin yes) didn't affect anything.

slybloty
  • 145
user283163
  • 1,459

5 Answers5

216

Simply adding a password for root is not enough for Ubuntu 14.04 Server.

You also need to edit /etc/ssh/sshd_config, and comment out the following line:

PermitRootLogin without-password

Just below it, add the following line:

PermitRootLogin yes

Then restart SSH:

service ssh reload

For Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-59-generic x86_64) PermitRootLogin without-password has been replaced by PermitRootLogin prohibit-password.

Daniel Le
  • 148
bdep
  • 2,161
39

You need to setup a password for the root account and then it will work.

sudo passwd

Enter same password twice.

P.S. After modifying /etc/ssh/sshd_config don't forget to reload the openssh server.

sudo service ssh reload
terdon
  • 104,119
cioby23
  • 2,535
30

With Ubuntu 14.04 Server.

Set the password

sudo passwd

Changes in /etc/ssh/sshd_config

Change PermitRootLogin

PermitRootLogin yes

You may also have to check value of PasswordAuthentication. If it is set to no then set to yes

PasswordAuthentication yes

Then restart SSH:

service ssh restart

3

For 14.04 you would have to comment below line in /etc/ssh/sshd_config

#StrictModes yes
muru
  • 207,228
-1

For me, none of these steps worked, I've even tried something I wouldn't ever try for something else then a toy vm: PermitRootLogin without-password

The only thing that worked for me was disabling the PAM module for this:

UsePAM no

This option is normally at the very end of the file. To be honest, I don't know the real drawbacks of this, but since you're not supposed to allow root login online, I guess it's okay for a private dev-vm.

Nevertheless, set a strong password, always. Nope this is not an exception. Not even only this time...

Kjellski
  • 117