-1

I am using Ubuntu 14.04.

I want to change the password of the root account. I tried the following procedure:

  • Login with my own account (that has the sudo permission)
  • sudo su root
  • passwd
    • Enter the new password twice.
    • I confirmed it said passwd: password updated successfully
  • exit
  • Trying to login root account with the new password via SSH --> FAIL!

Why passwd command does not work here?

Byte Commander
  • 107,489
syko
  • 119
  • 2
    Did you try to log in using su - or equivalent from your existing account? What is PermitRootLogin set to in /etc/ssh/sshd_config? BTW, it's not recommended to enable password access to the root account via SSH: it would be better to set up key-based authentication – steeldriver Jul 02 '16 at 21:30
  • 'PermitRootLogin' in /etc/ssh/sshd_config was the problem! thanks! – syko Jul 02 '16 at 22:15

1 Answers1

3

In order to log in with a password to the root account over SSH, as well as setting the root password you need to set

PermitRootLogin yes

in the remote system's /etc/ssh/sshd_config file.

NOTE: this is not recommended because it opens the root account to brute-force attack: if you need to log in to the root account directly over SSH (instead of logging in with a non-root account, and then using sudo), it is preferable to set up key-based authentication and set PermitRootLogin without-password instead.

steeldriver
  • 136,215
  • 21
  • 243
  • 336