Can't change root password, passwd doesn't do anything
I just got a dedicated server with ubuntu 14.04 on it. I haven't received root details in my server info email, but instead for a different user. So I wanted root access and tried to change the password.
I tried:
sudo -i
passwdand
sudo passwd rootAnd I entered my new root password, but when I try to login as root I still get denied access.
If anybody can help me it would be greatly appreciated. Thanks.
71 Answer
By default in Ubuntu the /etc/ssh/sshd_config file of the openssh-server has the following line:
PermitRootLogin without-passwordthis prevents to login into the ssh-server as root using password which is for security reasons, you can use key based authentication (and any other not using password) mechanism to login as root directly.
So you have two options:
First the bad option, avoid this one. Make the line of
/etc/ssh/sshd_configas:PermitRootLogin passwordThe good option is to login as another user who has access to the server, then switch to the root account by:
su - root ## Will need root's password.
or
sudo su - ## Will need calling user's password. The calling user needs to be able to use sudo. 2