sudo_root(8)

๐Ÿ“ฆ
version 1.9.15p5 ยท 2 versions
, in ubuntu noble

โœจ sudo_root(8) โœจ

okay bestie, welcome to the System Manager's Manual page for sudo_root ๐Ÿ’– this is the one that explains how to run administrative commands, and honestly? it's giving "you have main character energy AND root energy, but responsibly" ๐Ÿ‘‘


๐ŸŒธ NAME ๐ŸŒธ

sudo_root โ€” how to run administrative commands ๐Ÿซถ


โœจ SYNOPSIS โœจ

sudo command

sudo -i

๐Ÿ’… INTRODUCTION ๐Ÿ’…

okay so. by default, the password for the user "root" (the system administrator) is locked. this means you cannot login as root or use su, periodt. instead, the installer will set up sudo to allow the user that was created during install to run all administrative commands. it's the installer being your wingman fr fr ๐Ÿงš

this means that in the terminal you can use sudo for commands that require root privileges. all programs in the menu will use a graphical sudo to prompt for a password. when sudo asks for a password, it needs your password โ€” this means that a root password is not needed. no extra password to remember, we love that for us ๐ŸŒˆ

to run a command which requires root privileges in a terminal, simply prepend sudo in front of it. to get an interactive root shell, use sudo -i. that's it. that's the whole vibe check โœ…


๐ŸŽ€ ALLOWING OTHER USERS TO RUN SUDO ๐ŸŽ€

by default, only the user who installed the system is permitted to run sudo. to add more administrators, i. e. users who can run sudo, you have to add these users to the group 'sudo' by doing one of the following steps:

  • in a shell, do
sudo adduser username sudo
  • use the graphical "Users & Groups" program in the "System settings" menu to add the new user to the sudo group.

pick your fighter, both slay ๐Ÿ’…


๐Ÿ‘‘ BENEFITS OF USING SUDO ๐Ÿ‘‘

the benefits of leaving root disabled by default include the following:

  • users do not have to remember an extra password, which they are likely to forget. (real. so real.)
  • the installer is able to ask fewer questions.
  • it avoids the "I can do anything" interactive login by default โ€” you will be prompted for a password before major changes can happen, which should make you think about the consequences of what you are doing. a little friction is a feature, not a bug ๐Ÿ’€
  • sudo adds a log entry of the command(s) run (in /var/log/auth.log). receipts, always receipts ๐Ÿ”ฅ
  • every attacker trying to brute-force their way into your box will know it has an account named root and will try that first. what they do not know is what the usernames of your other users are. sneaky queen behaviour โœจ
  • allows easy transfer for admin rights, in a short term or long term period, by adding and removing users from the sudo group, while not compromising the root account.
  • sudo can be set up with a much more fine-grained security policy.
  • on systems with more than one administrator using sudo avoids sharing a password amongst them. no shared passwords, no drama ๐ŸŒธ

๐Ÿ˜ญ DOWNSIDES OF USING SUDO ๐Ÿ˜ญ

although for desktops the benefits of using sudo are great, there are possible issues which need to be noted:

  • redirecting the output of commands run with sudo can be confusing at first. for instance consider
sudo ls > /root/somefile

will not work since it is the shell that tries to write to that file. you can use

ls | sudo tee /root/somefile

to get the behaviour you want. (yes bestie, tee is the moment, trust ๐Ÿซถ)

  • in a lot of office environments the ONLY local user on a system is root. all other users are imported using NSS techniques such as nss-ldap. to setup a workstation, or fix it, in the case of a network failure where nss-ldap is broken, root is required. this tends to leave the system unusable. an extra local user, or an enabled root password is needed here. ngl this one's a real one ๐Ÿ˜ญ

๐Ÿ™ˆ GOING BACK TO A TRADITIONAL ROOT ACCOUNT ๐Ÿ™ˆ

this is not recommended! like, the manpage literally opens with that. please read it again. ๐Ÿ™

to enable the root account (i.e. set a password) use:

sudo passwd root

afterwards, edit the sudo configuration with sudo visudo and comment out the line

%sudo  ALL=(ALL) ALL

to disable sudo access to members of the sudo group.

that's it. that's the whole downgrade arc ๐Ÿ’€


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

sudo(8), https://wiki.ubuntu.com/RootSudo


and that's the page bestie!! ๐Ÿ’œ this was sudo_root(8) from the System Manager's Manual, dated February 8, 2006 โ€” yes she's an icon from 2006 and she's still serving โœจ go run your administrative commands responsibly, hydrate, and remember: your password, your power ๐Ÿ’–๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from