With the help of the command-line tool sudo, a particular user (or group of users) can execute some (or all) commands with root privileges while maintaining a record of all inputs and outputs. It functions according to each instruction. A “ticketing” method is implemented using timestamp files. A user is given a ticket for 5 minutes, for instance, if they run sudo and input their password. For another five minutes, each successive sudo command updates the ticket. The system administrator can use this utility to change the sudo conf file’s command duration. The conf file is also made up so that it can be copied to numerous machines. This article will show you how to add people to the sudo group. Ubuntu 18.04 is used.
Requirements
- Terminal Access
- 99RDP VPS
Making People Members Of The Sudo Group In Ubuntu 18.04
To begin, either use Putty or log into the computer using the provided command.
# ssh root@99RDP_VPS_IP
Use the provided command to upgrade the VPS’s software and repository list.
# apt-get upgrade
# apt-get update
- Create a new user by executing the provided command after the update is complete, then set the password..
# adduser test
- Enter it once more to validate.
- We will now use the usermod tool to add this 99RDP user to the sudo group.
A Linux programme called usermod can be used to modify a user’s settings remotely. You might need to modify a user’s attributes after establishing them, such as the password or login directory.
# usermod -aG sudo test
Authenticating Sudo Credentials
- Use the user command to switch to the new “test” account.
# su test
- Try listing the files in any root location after changing accounts without using the sudo command. For instance:
# ls
- Use sudo to execute the same instruction now.
# sudo ls
- Open the /var/log/auth.log file to view the logs for each sudo user account on the server. Enter the instruction when prompted to do so.
This will display a list of commands that sudo users have executed. You can see that the ls query was executed by the sudo user in the output.
Conclusion
We learned how to add users to the sudo group in this tutorial. This makes it easier for system administrators to manage checking freshly created user accounts for different criteria. This gives you greater power over the degree of permissions you give to particular users. Please stop by if you have any queries or suggestions.
Read Our Next Articles How To Modify Hostname Ubuntu 18.04: