Sudo users are those users who can execute sudo command. Sudo command grants temporary administrator privileges like authority to install programs, modify system settings and system files.
As these can modify the system settings and cause harm to the system, these privileges are only reserved for the root users. But by using sudo other users can also enjoy this authority. That’s why it’s important to allow only trusted users to be sudo user.
ssh root@server_ip_address
Here replace server_ip_address with the network IP address of your server. Then enter your credentials when prompted.
# adduser username
Here remember to replace username with the username you want to have for your new account. (For example, we are creating an account by username lotoftech.)
# passwd username
Here again, replace username with the username of your account. You will not see anything while typing the password. Retype the password to make confirmation.
Changing password for user lotofetch.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
# usermod -aG wheel username
On CentOS systems, users of wheel group are granted sudo access by default. Hence here we are adding the new user to the wheel group.
This creates a new sudo user in CentOS. Now let’s verify if the newly created sudo user account works.
su - username
This command will switch the user account to the new user account created.
username$ sudo command
Run above command while replacing command with whatever you would like to try. You will be asked to enter user account password enter that and you should see command work.
Here we saw how to create a sudo user in CentOS. We hope you it worked for you. If you face any problem or something is not working for you do tell us in comments.
If you are using a Linux system you know how important a good text editor is. That’s why here are the best text editors for Linux you can try using.
You can utilize a wide range of tools as a Linux user to keep organized, manage your time, and become… Read More
Have you ever caught yourself in a situation where you need details of an audio/ video media file? When you… Read More
If you have installed Linux alongside windows in the dual boot you might have noticed that every time you boot… Read More
Linux kernel is like the core of the operating system. It's a piece of software that works as a middle… Read More
Nowadays, most Linux Distros already have Python preinstalled. But you might have a distribution that might not have Python preinstalled.… Read More
Python is one of the most popular and easy to learn programming languages. Its a widely used high-level programming language… Read More
Just so that you know we use cookies on our website. Want to know more
read here