How to use adduser command In Linux
In this approach, we will use the adduser command, The adduser command is a wrapper around the basic system management commands like useradd and usermod, … and is commonly found in Debian-based systems like Ubuntu. This command can add a new user and also able to update a user account Information with the provided data. To add the user to the sudo group, the user should exist in the system.
Command:
sudo adduser username sudo
Output:
In the above image, we can verify whether the user is added to the sudo group with the id command.
How to Add User to Sudoers in Ubuntu
Sudo is a command line tool in a Unix-based system that allows a regular user to run a command as the superuser or another user. Only the super user is allowed to modify the majority of the System-wide settings and configurations. It is not advisable to run any Linux machine as a super user, so always create a normal user for day-to-day usage. To use the super user privileges we don’t need to log in as root users every time, just provide the sudo rights to a normal user to portray the normal user as a root user. It is often done with the help of Sudo group or sudoers file in Linux systems.
In this article, we will discuss how to add a normal user to the sudoers list so that the normal user can use the Sudo command to perform privileged operations.