Linux - Arch How to Set up SUDO
Arch Linux is known to not be the most user friendly distro because it does not come with most of the packages other distros installs and configures by default.
sudo
is well known tool that allows a system administrator to delegate authority to other users.
1) Installing Sudo
Let's install and basically configure sudo
in our Arch box.
pacman -S sudo
After the installation you might want to change the default text editor used by visudo
to edit the /etc/sudoers
configuration file.
In my case, because I like to use vim
I have added the above line to my bashrc
file.
2) Adding a new Adminstrator
Let's create our new administrator.
useradd -c 'Management User' tiago
I am going to follow the tip on the Arch Linux wiki about adding new administrators to the system adding the recently created user to the wheel group.
getent group wheel
wheel:x:998:tiago
3) Setting Permissions
It's time to allow the members of the wheel group to use sudo. Let's edit the sudoers file adding the below:
Conclusion
With the steps above we have set up a basic adminstrator in our system. However, sudo is very powerful and extremely customisable. For more sophisticated settings and permissions check the links listed below and the file /usr/share/doc/sudo/examples/sudoers
.