How to add a user to the sudo group in a Linux VPS?
How to add user to sudo group in a Linux VPS?
Collapse
Unconfigured Ad Widget
Collapse
X
-
Hello Annie_P,
You can provide special privileges to any users or group with Sudo. However, there are few commands which can only be accessible to root users in Linux. With sudo, you can authorize the required user who can run those commands with sudo. For example, the Reboot command can be run only by the sudo user or root users.
Below given are the steps to enable passwordless sudo for User:- Login to your Linux server with the root user using ssh.
- Let us create a user. Here, we will create a test user.
Code:# adduser test
- Set Password for user test.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.- Now, add the above user to the Sudo Group:
- Check if the wheel group is enabled on the server.
- Type the below command to open the configuration file,
Code:# sudo visudo
- You need to uncomment the %wheel line by removing the # sign to enable the wheel group.
# will allow peoples in group wheel to run all commands
Code:%wheel ALL=(ALL) ALL
Add user test to the wheel group:
Code:# usermod -aG wheel test
To verify the new user with sudo privileges, log in with the test user and run the below command,
Code:# sudo whoami
It should provide the below output; if a user is added with sudo privileges,
Code:# Output root
-----------------------
Regards,
Rex Maughan
Comment