Where do I have to go to purchase the root password?

Greetings all,
I just installed 16 LTS on a Power MAC G4. After rebooting into the newly installed
system, I was prompted to update the system with the latest versions of some
of the applications installed. All attempts failed, indicating a network issue.
However, the network is working just fine for everything else. So I surmised
that it must be due to permissions. So I attempted to su to root, but I cannot. I
was never prompted to provide a root password during the install. I have considered
booting to single-user mode, and setting the root password. But before doing so, I
thought I might ask why the ability to set a root password is not provided
during install. I come from ~30yrs on BSD, and UNIX, and this is highly unusual.

Thank you for all your time, and consideration.

ā€“Chris

I donā€™t think macā€™s are any different. Hereā€™s what I know about root sudo.

https://help.ubuntu.com/community/RootSudo#Enabling_the_root_account

https://ubuntuforums.org/showthread.php?t=2107090

https://ubuntuforums.org/showthread.php?t=2064908

No it's not.
Considering disabling root password is the standard practice in Ubuntu, and Ubuntu is the dominant GNU/Linux distro.
You just don't do things with a root password. You just use sudo when you need root access.

Here's how you get a root prompt:

ouroumov@Box:~/Desktop$ sudo su
[sudo] password for ouroumov: 
root@Box:/home/ouroumov/Desktop#
2 Likes

Hi @chris.h, I remember the first time I saw the sudo security model, too, and I believe it was about 12 years ago. Only a few things were impossible to do and all became moot with time. The sudo method has become highly ubiquitous in Linux.

The paradigm is the root user has no password so thereā€™s no way to even brute force the root account - the only always-known account name in all of *nix at that point. Of course, it just shifts the security model to a user account with ā€˜sudoerā€™ permissions.

BTW, replace su with sudo -i to pretty much do the same thing.

Also, I noticed su = switch user has strangely morphed into su = super user somewhere along the way, too. :slight_smile:

Installer should have asked for password during install when setting up user account options
installer usually adds username to group access for sudo, but not su.

you can add user to su group after install, but the possibility of forgetting to exit root account is why single sudo commands are better option

You removed context. I indicated that I come from over 30 years in UNIX, and this
is highly unusual. Meaning; it's highly unusual in UNIX :smile:

Thank you for taking the time to respond, @ouroumov , and to provide the preferred
incantation. Greatly appreciated!

For those with a different security model in mind;
I used the following:
sudo passwd root
Which gave me the results I had hoped to obtain.

Thanks again, @ouroumov ! :smile:

3 Likes

I can appreciate that. But fortunately the change in the shell prompt from $ to #
keeps me ever mindful. :wink:
Thanks for the reply, @nikgnomic !

Thanks for the reply, @Bill_MI!
Indeed. It really comes down to me getting an understanding of the
different philosophies ā€“ UNIX vs Linux. :stuck_out_tongue:
Like it, or not. Iā€™m just going to have to learn to live with it, if I want to adopt
the use of a Linux based OS, on top of the all the UNIX based servers, and
desktops I currently maintain. :smile:

Thanks for the reply, @Bill_MI

ā€“Chris

1 Like

Heya @ouroumov,

sudo su vs sudo -i

Thereā€™s some subtle environmental differences and itā€™s been a while since I looked. One quick one is how $PATH differs but I recall it extended to using /root/.bashrc but that no longer seems to be the case.

I wonā€™t count the benign difference in the directory you end up in. :slight_smile:

1 Like

I generally use sudo -i to get to root prompt. Is that approach any different than sudo su ?

Iā€™m not sure about the difference. But, I do know that ā€œsudo suā€ will immediately take you to the root prompt

1 Like

Okay, I have found out the difference:

Sudo su, takes you to root immediately

Sudo i takes also you to root. However, the -i (simulate initial login) option runs the shell specified by the
password database entry of the target user as a login shell. This means that login-specific resource files such as .profile, .bashrc or .login will be read and executed by the shell.

for pretty much any use I can personally envisage, sudo su should suffice. But, I would be interested to hear of any advantage from anyone else regarding the other method.

1 Like

Hi Steve, I imagine the biggest difference would be some package relying on something specific in one of those files.

One difference seems to be /snap/bin in $PATH. It must be so important I see it in there twice. :slight_smile: