Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set a blank password for the root user in slitaz [closed]

I am running slitaz distro, and would like to completely remove the root password. I have tried giving a blank password to the passwd command, however that did not seem to do the trick. It gave me an error password was too short, ans it still asked me for a password when I ssh-ed in. The password was just hiting the "Enter" key.

UPDATE:
Perhaps it has to do with the fact that slitaz uses dropbear for ssh? Because even with a blank password for root in /etc/shadow, it still prompts for a password.

like image 882
Plazgoth Avatar asked Jul 28 '12 11:07

Plazgoth


People also ask

Can Root have no password?

No root password means nobody will be able to log in, thus hackers will never be able to completely mess up a system. Furthermore, users can still get a root shell with sudo by doing sudo -s or sudo su .

How do I change root password in Linux?

At the command prompt, type 'passwd' and hit 'Enter. ' You should then see the message: 'Changing password for user root. ' Enter the new password when prompted and re-enter it at the prompt 'Retype new password.


1 Answers

Did you try passwd -d root? Most likely, this will do what you want.


You can also manually edit /etc/shadow: (Create a backup copy. Be sure that you can log even if you mess up, for example from a rescue system.) Search for "root". Typically, the root entry looks similar to

root:$X$SK5xfLB1ZW:0:0... 

There, delete the second field (everything between the first and second colon):

root::0:0... 

Some systems will make you put an asterisk (*) in the password field instead of blank, where a blank field would allow no password (CentOS 8 for example)

root:*:0:0... 

Save the file, and try logging in as root. It should skip the password prompt. (Like passwd -d, this is a "no password" solution. If you are really looking for a "blank password", that is "ask for a password, but accept if the user just presses Enter", look at the manpage of mkpasswd, and use mkpasswd to create the second field for the /etc/shadow.)

like image 80
tiwo Avatar answered Sep 20 '22 12:09

tiwo