Changing my user password created a root account. Is that normal?

I previously had a sudo setup with my regular user (who was the only user). I changed the password thusly:


mark@localhost:~> passwd mark

Then, I discovered that user “mark” no longer had sudo privileges, and there was now a root user with mark’s old password. So, I then changed root’s password. Is it normal to be able to create a root account so easily from a prior sudo setup? It’s not a big deal for me, since I come from a Debian background and am used to having a root account. But it struck me as odd. Perhaps this is completely normal, but I thought I would ask.

I’m using Leap 15.2.

I’m not sure what you are asking. What you describe seems normal to me, so I’m not sure what puzzles you.

Many openSUSE users do use a root account when doing administrative chores. The default “sudo” setup is that you are prompted for the root password. However, the default install will setup root to have the same password as the user you define during install.

I suspect that may have confused you. You probably never had an sudo setup with your regular user. You just thought you did, since the password for the regular user worked (until you changed it).

The Ubuntu setup (which I never liked) is to put the default user in the “wheel” group, and configure “sudo” so that anybody in the “wheel” group can use “sudo” with that user’s own password. You can configure “sudo” that way, but the current default setup for openSUSE is that “sudo” requires the actual root password.

I also do not quite understand what you did (do?)

When user mark called

passwd mark

that seems a bit superfulous, because user mark can only change his own password and thus it is sufficient to do

passwd

But I guess it would work also.

Then you say that root has the password of mark. Is that the old or the new password?
Also was the password of root different?

Then you changed the root password. You did that as root using

passwd

?

And you talk about a sudo configuration, but you does not show any. So how are others supposed to comment on that?

When you first installed openSUSE, by default you created a regular User account and assigned the same password to the root account.

See the screenshot from the installation from my presentation slide deck

See that first green checkbox in the screenshot? That’s where the root account is assigned the same password.

So,
Then of course when you changed the password for the User account, there was no change to the root account and now each have a different password.

But, last I checked your “mark” account should still be able to “sudo” – You would have to provide the old root password though if you’re using sudo to gain elevated permissions and not switching to another ordinary user account. The rules haven’t changed, it’s just that now if you want root-like permissions, you need to provide the different root password instead of the user’s own password which is no longer the same as the user.

You will find that unlike many distros like Debian and Ubuntu,
openSUSE has no objection to your using root, and fully supports “su” “su -” and although not recommended you can also login interactively as root.

You’ll even find that we even regularly recommend fully elevating permissions within a windowed console, saving you the inconvenience and extra typing “sudo” for each command (yeah, I also know that you can invoke sudo for the session and not just the command, too). If you elevate within any windowed terminal except xterm (eg konsole gnome-terminal, xfce4-terminal, etc) you’ll find color coding helps to remind you that you’re not working with normal user permissions.

TSU

Okay, thanks for the answers. So, it is very simple to create a root user in a system that was set up to be sudo based rather than root based. I didn’t know, since I’ve always used root based systems. Again, it was by accident that this happened. I hadn’t even set out to enable the root user. I just wanted to change my own password, not enable root.

It is quite ununderstandable (at least to me) what you want to say here.

Each Unix/Linux system has one user that has the username “root” and, most important. has a UID=0.

All other users are “normal” users. Some of them are to support packages (mostly UID >0 and <1000) and the ones you will know best are the users that log in in the system to do their day-to-day work IUID from 1000 upwards). Of these last one many people, special on laptops, only have one.
You can see all of them in /etc/passwd.

So saying things like “to create a root user in a system” is nonsense. There is one and only one user root created at system installation and that is it. You can not enable or disable it (better not even try) and there not such a thing as “a root based system”.

I’m not at all sure what you are saying there. However, openSUSE is not “sudo based” (whatever that means). Rather, “sudo” is provided as an optional administrative tool for those who want to use it. You can use openSUSE systems without ever using “sudo”.

Exactly how, did you setup an openSUSE system to be a “sudo” system?

  • Which method did you use? – From which source?

Huh?

  • Even if the user “root” has been disabled – as is the case for Ubuntu and, AFAIK, for some Sun UNIX® systems – there still has to be an entry in /etc/passwd for the UID ‘0’ and the GID ‘0’ – something has to “own” the system – including the systems “root” not the user
    ] directory “/” – and the system as such – including the Kernel …

<The Linux Documentation Project;
<The Linux Documentation Project;
<https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html&gt;

And, for the case that, we have a part of the audience which is not convinced – there’s the Linux Standard – <https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/usernames.html&gt; –

  • A required user name is “root” and a required group name is “root” …

with the exception that both the User ID and Group ID for the user root shall be equal to 0.

For those confused by my initial post, this quote above from tsu2 describes what occurred. In retrospect, perhaps I should have used “sudo passwd” rather than just passwd, to maintain the original status of “use this [the regular user’s] password for system administrator”.