What is the password to switch user to root. I just put the new ad card into rpi3b and in trying to su root I am asked for a password and I enter raspberry and get authentication error.
3 Answers
root
user on Raspbian doesn't have a valid password at all. This is an intentional security measure which prevents someone from logging in as root
to your board. Raspbian comes with a default pi
user who has a password raspberry
; once you change that password your RPi gets some basic security. Having a default root
password would require you to change passwords for both users in order to secure your RPi.
You can set root
password by running sudo passwd
. This is only recommended if you want to play with login scripts of your pi
user or sudo
settings - having a root
password will enable you to login and rescue your system if you accidentally lock yourself out of your pi
account or break sudo
(the latter specifically can only be fixed if you login as root
). Otherwise I wouldn't do it.
-
1"in Linux a user without a password isn't allowed to login at all" -> Not quite. Depending on how
/etc/passwd
and/etc/shadow
are set-up, you can have a user with no password who can login by entering an empty password, or a user with no password who cannot login with any password. If you want to try the former withroot
, edit/etc/shadow
and remove the asterisk from between the first set of colons, so that line beginsroot::
. You can now login as root with no password. Seeman 5 shadow
.– goldilocks ♦Commented Nov 14, 2016 at 16:00 -
@goldilocks Thanks, I have (hopefully) fixed my answer by removing the wrong part. Commented Nov 14, 2016 at 16:09
If I remember correctly there is no root password by default.
If you want to login as root try
sudo su # login as root
passwd # set-up a root password
-
There's always a root user; pretty sure it's the only one that must exist. Although in a sense that might not be true if UID 0 is always presumed to be valid. Anyway, there is an explicit
root
on Raspbian, just password logins are disabled by default.– goldilocks ♦Commented Nov 14, 2016 at 15:53 -
root
password, as @joan suggested - however there is no need. Most of the experienced users DO NOT do this, but run commands withsudo
when root access is needed.