Raspbian root user password

12/30/2015 13:44 Mr.Tr33#1
Hello,

I have a new installed raspbian on my raspberry pi 2 and I'm trying to set the password for the root user. Also I never changed the password of the user root pi.

Currently I'm in the pi user over ssh and tried those few things:
Code:
sudo passwd
Code:
sudo passwd root
Code:
sudo -i
sudo passwd
Code:
sudo su
passwd
Code:
raspi-config
After each step I tried to connect over ssh and sftp and it never worked. It worked each time with the pi user and the normal password.

Can anyone help? I can't even use no password with the root user.

Sincerely
Mr.Tr33
12/30/2015 15:20 Jeoni#2
I guess that the root login is disabled in the OpenSSH config. That is an easy security measurement, but if you want to override it, edit (e.g. via nano) /etc/ssh/sshd_config. Search (with nano ctrl+w) for the line containing "PermitRootLogin". Whatever is written there, overwrite it with "PermitRootLogin yes". Now save the file, close the editor and restart the ssh service ("service ssh restart"). Now you should be able to login with the root user right away through SSH / SCP (can't tell it for SFTP, as I don't use it).
With best regards
Jeon

P.S.: I'm sorry, if some commands may not work on your system. As I don't have a raspbian machine, I gave you the instructions for a regular debian (jessie) system, but I guess there is not much of a difference.
12/30/2015 16:31 Mr.Tr33#3
Wow thanks it worked :)

Code:
PermitRootLogin without-password
That was there before. But I guess it means that I don't need a password. But it didn't work without one.
12/30/2015 17:44 Jeoni#4
I'm glad it worked.
Just for your information:
Code:
PermitRootLogin without-password
does indeed mean that you don't need a password (even if one corresponds to the root user). But (even so it's not written there), it implies, that the client, that wants to login to the root account via SSH / SCP needs a valid certificate (or key) that was issued using the SSH servers private key. Of course, that needs to be preparated.
Logging in using the root user and don't need to provide a password or a valid certificate as default option would be a bit unsecure ;)

With best regards
Jeoni