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
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.How-To: Recover root password under linux with single user mode 1 minute read It happens sometime that you can’t remember root password.On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode. This tutorial will show how to boot Linux in single user mode when using GRUB and finally how to change root password.
Dropout8,97999 gold badges3333 silver badges8686 bronze badges
PlazgothPlazgoth
45311 gold badge55 silver badges1515 bronze badges
closed as off topic by Mike Kwan, thiton, Don Roby, Jason Sturges, GravitonJul 30 '12 at 6:43
Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.
1 Answer
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 There, delete the second field (everything between the first and second colon):
Save the file, and try logging in as root. It should skip the password prompt. (Like
tiwotiwopasswd -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.)2,18911 gold badge1313 silver badges2323 bronze badges
Not the answer you're looking for? Browse other questions tagged linuxloginuser-accountspasswd or ask your own question.
Setting the default root password: Some Live Linux distributions are created without a root password by default (the root account is inactive). This is particularly true with Debian based distributions like Ubuntu. Setting a root password enables us to access some essential tools such as the synaptic installer. In most cases, having no root password is fine when your running from a Live CD and don't need to do administration tasks, make changes or install additional packages. But for those of us who do want to make administrative changes and save them back to a USB device or local storage device on for example a properly created 'casper-rw' partition. Setting the root password might then be necessary.
How to set the default root password:
This process is known to work on most Debian based LIVE distributions like Ubuntu or Pendrivelinux releases previous to Pendrivelinux 2008. Other distributions may vary.
- Open up a terminal and type sudo passwd root
- Follow the onscreen instructions to set and confirm your new password