Empty root password

Hi,

I wanted to delete the root password temporally (give my notebook to manufacturer to fix stuff).

So, I did

sudo passwd -d root

thinking this will make an empty password for root.

As in man passwd it says -d "Deletes a user’s password (makes it empty).

Now, the password is neither empty, nor is it my old root password.
I can’t log in as root any more…

So, what did I do wrong?

Best
Marc

AFAIK, you need to modify the PAM configuration to allow passwordless login.

This should do I think:

sudo pam-config -a --nullok

See also “man pam-config”.

If you want to login to a graphical system without a password, you may have to adjust your display manager’s config too.
Most should respect the settings DISPLAYMANAGER_PASSWORD_LESS_LOGIN=“yes” in /etc/sysconfig/displaymanager, I suppose.

Thing is, I can’t do sudo anymore.
If I enter my old password, it’s wrong.

Is there some kind of fallback password that is set?

Obviously.
You deleted the old password, so the system doesn’t know anything about it any more.

What if you just press enter when asked for the password?

Is there some kind of fallback password that is set?

Not if you deleted the password.

Maybe “su -” still works? (probably not though)

If all else fails, press ‘e’ at the boot menu and append “init=/bin/sh” to the line starting with “linux” or “linuxefi”, then press ‘F10’ to boot.
You should get to a minimal text mode system then, where you should be able to change the root password again with “passwd”.

Is it possible to remove the root password or empty?
For example, when i run the gparted I would not password (Do not ask me password )

How to run an application or apps using sudo without a password?

The above is another question then the original one (as given in the title and discused in the posts). Please do not try to hyjack the thread. Also, when you start a new thread, with a good title that covers your question, there will be more chance that the people you need will see your question.

@mrc

It seems like you have 2 different problems now…
1. Boot into your system and change your root password
You can do this using a LiveCD and chroot into your system or you can append a useful command when your GRUB menu appears to alter how your system boots the rest of the way.
This ArchLinux article describes how to do it from a LiveCD or the GRUB menu
https://wiki.archlinux.org/index.php/Reset_root_password
This RHEL article describes another method using a modified GRUB boot which might even be easier
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/4/html/Step_by_Step_Guide/s1-q-and-a-root-passwd.html

2. Set Root Password to null
I’d recommend a different approach to setting up a no-password root account when handing your machine to some techs… For one thing, once you get your machine back you’ll have to undo your modifications. Instead I recommend setting the root password to something stupid and simple like

Password1

Then write that down on a 3M sticky note and stick on your keyboard or display with the lid closed so it doesn’t get lost.

HTH,
TSU

Note that root is likely mounted read-only at this point, so at the very least one need to make /etc writable by using “mount -o remount,rw /”. Alternative is to use “passwd -R” from live boot after mounting real root.

Oh, and as long as we are on openSUSE - yet another alternative is to revert to snapshot before password was deleted :slight_smile:

Hi, didn’t have my system for a while now, sorry. So, basically I told the guys that I locked myself out. They just installed openSuse again. Now, everything is working again, but wouldn’t it make sense to have a warning before deleting the root password? I mean not a “this is a security issue” warning, but more like a “this will not work” warning. To the solution above: Just trying to log in with empty password did not work. I tried that too. Best Marc

Not the Linux/Unix way. And it is legal to not have a password. Linux assumes you know what you are doing and does exactly what you ask it to do.

This was exactly my thinking when I deleted the password.

As in the manual:

-d, --delete
           Delete a user's password (make it empty). This is a quick way to disable a password for an account. It will set the named account passwordless.

But eventually it was not legal for my to delete the password.

This has nothing to do with “legality”. And I am sure tht the command did exactly as described: it removed the root password from /etc/shadow. Remember that Unix/Linux does what you tell it to do, not what you want it to do.

The passwd tool has no knowledge of the usage of PAM. The caveat is that when reading the man page of a tool, one only gets the very technical description about what the command does and what the otions are, etc. do. There is normaly verry little documentation about the environment a tool is supposed to work within or the wider knowledge that is assmed to be available to the user through courses, books or try and error…

Man pages assume that you have some deeper Unix/Linux knowledge, they often are more of a help to people who know what tool to use in what circumstances, but who can not remiind how exactly the syntax or options are.

For many of these cases that are to be done on a day to day frequency by many people there are tools (often GUI oriented) like YaST, that offer an higher abstract level and then “know” where to change what.

Well, actually it is legal to have an empty root password (that’s how the LiveCDs are set up e.g.).

But your system was configured to not allow passwordless login nor using su or sudo without a password.
And as a side-note, that’s not something passwd can check anyway.

Btw, from “man pam_unix”:

       **nullok**

           The default action of this module is to not permit the user access
           to a service if their official password is blank. The nullok
           argument overrides this default.