The config file /etc/sudoers
lists the users who are allowed to run which commands as which user.
On Ubuntu, this file contains a line allowing all users of the sudo
group to run commands as the root
user.
To check which users are in the sudo
group you can type getent group sudo
. You can also check the groups of your current user by typing id
.
To allow another user to run sudo
, you can add them to the sudo
group:
sudo adduser username sudo
Or, if your current user can't run sudo
, you will need to boot into "Recovery mode" from Grub (hold shift
while booting, if your grub menu doesn't show up automatically), or add single
to the linux ... initrd ... quiet splash
line, then:
mount -o rw,remount /
adduser username sudo
Run adduser
for each user you want to be able to sudo
. Then exit & resume.