Add User to Sudoers
Step 1 : To give additional users access to sudo, all you would need to do is add them to the sudo group
Configure sudo
Step 2 : User with sudo privileges access to everything, and that may or may not be what you want.
To actually configure sudo, we use the visudo command.
By default, Ubuntu opens up the nano text editor when you use visudo. With nano, you can save changes using Ctrl + W, and you can exit the text editor with Ctrl + X.
Step 3 : This is the line of configuration that enables sudo access to anyone who is a member of the sudo group
Step 4 : You don't have to enable access by group. You can actually call out a username instead.
The first ALL : means that root is able to use sudo from any Terminal.
The second ALL : means that root can use sudo to impersonate any other user.
The third ALL : means that root can impersonate any other group.
The last ALL : refers to what commands this user is able to do
Step 5 : I'll give some additional examples.
Step 6 : We're allowing user username to execute the reboot and shutdown commands. If user username tries to do something else (such as install a package / update), he will receive an error message:
Step 7 : We're allowing username to impersonate other users. we could just remove the (ALL:ALL) from the line altogether to prevent username from using the -u option of sudo to run commands as other users: