I am looking for the name of the superusers list on Fedora. (On Ubuntu is seems to be "sudo".) I want to add one of the users to the superusers list.
groups command only lists the groups of the current user.
There is only one superuser on Fedora and i.e.
root. If you are looking for other user's who have the
sudo privilege then you can look into /etc/sudoers file by executing command
Here you can add any user to have the
sudo privilege, by adding the following line at the end of the
loginname ALL=(ALL) ALL
To list all available groups with users in them you can use
or just look the content of
By the way, on ubuntu there is only one superuser too. It is root. All others just are allowed to use it privilleges via sudo. You can modify rules in /etc/sudoers via
visudo as mentioned above, if sudo is installed. This is true for any main stream GNU/Linux distro.
To add a user to a group, such as wheel your can use the
vigr command. You will also need to use
vigr -s to update the shadow file.
“Superusers”, as in the users who can obtain administrative privileges, are the users who either know the
root password or are authorized to execute commands as
root with a mechanism such as
sudo. These days, sudo is the most common and generally recommended mechanism.
There is no general rule to tell which users are allowed to gain privileges with
sudo, it is a matter of convention. Look in the file
/etc/sudoers for a line like
%sudo ALL = ALL
This means “Users in the group called
sudo are allowed to run any command as any user”. Sometimes you'll see
(ALL) after the equal sign: it's an optional way to restrict the line to work only on a particular machine (if you put a host name instead of
ALL), which allows deploying the same configuration file to multiple machines with different intended privileges.
If there is such a line, you can add users to the
adduser bob sudo
You can review who is a member of the
sudo group by listing the group database:
getent group sudo
If there is no
%wheel, as I said before the name is a matter of convention, and there can be more than one such entry), you can create one with
addgroup and add the line to the
sudoers file (use
visudo to edit that file). Alternatively, instead of creating a group, you can add individual entries to the
sudoers file (again, use
visudo to edit this file):
bob ALL = ALL
Using a group makes management a little easier because you can see at a glance who is a member of this group.
It is perfectly well possible to have more than one user with root privileges, it is uncommon to create them though. You can create a user and assign it UID 0, just make sure the first line in /etc/passwd is always for
root. For most users it is bad practice to do this though.
To list all users with
grep -E '^[^:]*:[^:]*:0:' /etc/passwd