How to Create Sudo User on Ubuntu
Table of Contents
Create Sudo User on Ubuntu
sudo is a Linux command which provides a mechanism for allowing administrator privileges to a normal user. In this tutorial, you are going to learn how to create sudo user on Ubuntu.
Before you start to create sudo user on Ubuntu. You must have the root user account credentials of your system.
Create a new
First Log in to the server as a root user.
ssh [email protected]_ip_address
Now to create a new user account we will use here,
adduser command. To add new user run below command replacing
NEW_USERNAME with the username you want to add.
Here you will be prompted to enter the password for the user you want to create and confirm it. Enter a strong password for the new user you are creating:
New password: Retype new password: passwd: password updated successfully
Now after setting the password, it will create the HOME directory for the user saving some configuration files. Then it will ask you some more information about that user.
Changing the user information for username Enter the new value, or press ENTER for the default Full Name : Room Number : Work Phone : Home Phone : Other : Is the information correct? [Y/n]
To add newly created user to
sudo group you should use
usermod -aG sudo NEW_USERNAME
Test the sudo user access
Now you switch to new account using
su command to do so run below command:
su - NEW_USERNAME
Then run command
whoami to confirm sudo access:
If you have sudo access then you will get below output:
How to use sudo
You can only use sudo account to display contents of
sudo ls -la /root
Now enter the password of the new user to get the list of files:
[sudo] password for username:
You have successfully learned how to create sudo user on Ubuntu. If you have any queries regarding this then please don’t forget to comment below.
How to Install Skype on Fedora 29
How to Stop and Disable FirewallD on CentOS 8
How to Install Google Chrome on CentOS 7
How to Install CMake on CentOS 8
How to install XAMPP on CentOS 7
How to Install PhpStorm on CentOS 7
How to Install FFmpeg on Ubuntu 18.04
How to Install Dropbox on CentOS 8 Server
How to Install PyCharm on Debian 10
How to install Django Web Framework on Debian 9
How to Install Google Chrome on Debian 9
How to Install Eclipse IDE on Debian 10