![]() ConclusionĬreating a sudo user in Ubuntu is an essential step in securing your system. If the user has administrative privileges, the system will return ‘root’ as the output of the command. To verify that the new user has administrative privileges, run the following command: sudo whoami If the password is correct, you will log in as the new user. Here, replace ‘username’ with the name of the user you created in step 2.Įnter the password for the user when prompted. Once you have added the user to the sudo group, you can verify whether the user has administrative privileges or not by running the following command: su - username Here, replace ‘username’ with the name of the user you created in step 2. Run the following command to add the user to the sudo group: usermod -aG sudo username To do this, you need to add the user to the sudo group. The next step is to grant administrative privileges to the newly created user. You will be prompted to set a password for the new user. Here, replace the ‘username’ with the name you want to give to the new user. You can create a new user account by running the following command: adduser username Once you have logged in as the root user, the next step is to create a new user account. To do this, open a terminal window and enter the following command: sudo su -Įnter your password when prompted to gain root access. Step 1: Log in as Root Userīefore creating a sudo user, it’s essential to log in as the root user. In this article, we will guide you on how to create a sudo user in Ubuntu. Therefore, it is recommended to create a sudo user in Ubuntu to manage the system’s administrative tasks while limiting the risk of system damage.Ī sudo user is a regular user account that has been granted administrative privileges, allowing them to perform tasks that require root access without logging in as the root user. However, giving full access to the root user can be risky, as it can lead to unintended system changes or even system failure. Please don’t hesitate to post your queries and feedback in below comments section.In Ubuntu, the root user has full access to the system, which means that they can perform any task or modify any file without any restriction. we hope you have learnt how to create a sudo user on ubuntu Linux from command line and desktop environment (GUI). To start using this user, logout and login with this user. Great, above window shows that sysops user is created as a sudo user (administrator). It will take us to the following window, click on unlock and enter your user’s password,Īfter entering the credentials, click on Add User option and specify the user details like full name, username, standard or administrator (sudo) and password. If you are not comfortable with command line and wants to create a new sudo user from GUI then refer the below steps.įrom the Activity, search users and click on user’s icon as show below, Creating new sudo user from Desktop Environment (GUI) ![]() After that interval, it will prompt to enter password again while executing sudo command. When we run the command with sudo first time then it will prompt you to enter user’s password and will save it for next 5 minutes. # su – sysopsĪs we can see above, sysops user is able to run admin commands by putting sudo in front of each command. To test sudo access, switch to sudo user and try to run some admin commands by placing sudo in front of command. # usermod -aG sudo > Testing Sudo User Access To add an existing user to sudo group, run Output of id command confirms that sysops user is created successfully, now add this user to sudo group using usermod command, # usermod -aG sudo sysops ![]() ![]() This command will prompt to set password of sysops user and other details as shown below, To create new sudo user, open the terminal and switch to root user and run following command, In this post, we have tested following commands on Ubuntu 22.04 LTS (Jammy Jellyfish). If we add any regular user to that sudo group then that user will have sudo admin rights. When we install Ubuntu Desktop or Ubuntu server then a group named ‘ sudo’ is created automatically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |