Hello everyone, I would like to share about how to create and delete sudo user on Linux. Because in Linux we can implement multi-user, of course creating a user and granting sudo access is important in my opinion. Especially for SysAdmin where it must be able to manage which users can access the server and its privileges. For that, just use root access to make the process easier and here’s how:
Creating Linux User
First, we create the Linux user first:
useradd -m userName
Second, we give the user a password:
passwd userName
Provides Sudo Access to Linux Users
Next, we give the user sudo access we have created:
usermod -aG sudo userName
commands for debian / ubuntu / linux mint
usermod -aG wheel userName
commands for fedora / redhat / centos
Test Sudo Access on Users
after we give access, try to test it, by logging into the new user and running a command with sudo access then you will be asked for the password of the user you created :
su - userName
sudo yourCommand
Something like this from creating to testing a user with sudo access :
Also Read : How to Install Live Wallpaper on Ubuntu
Removing Sudo Access on User
If at any time you want to remove / revoke sudo access on a user, use the following command:
deluser userName sudo
commands for debian / ubuntu / linux mint
Especially for centos you have to delete the user that you have created by accessing theĀ /etc/sudoers
file or the quick way by typing visudo
.
Well, that’s how to create and delete sudo user on Linux which I can share. Hope this information is useful, Thank you ^^,
0 Comments