How to create a new user and grant them sudo permissions
To create a new user and grant sudo permissions, you can follow these steps:
- Open a terminal window and either log in as the root user or login as a regular user and then switch to the root user.
- Create a new user using the following command, for example, let’s create a user named newuser:
- Create a new user with administrative privileges.
- Create a new password for the new user.
- Change the password for the newuser account using sudo.
- Grant new users sudo permission by adding them to the sudo user group.
- Add the user “newuser” to the sudo group.
- Make sure that the sudo user group has been installed and configured properly. If it is not installed, you can use the following command to install it:
- Install sudo using apt-get command.
- The new user has been created and granted sudo privileges, allowing them to log into the system and use the sudo command to perform tasks that require administrator permissions.
Please make sure to only add users that require sudo privileges to the sudo user group to avoid security risks.