{"id":70398,"date":"2022-10-14T10:15:00","date_gmt":"2022-10-14T14:15:00","guid":{"rendered":"https:\/\/jumpcloud.com\/?p=70398"},"modified":"2024-01-23T15:55:14","modified_gmt":"2024-01-23T20:55:14","slug":"how-to-create-sudo-user-manage-sudo-access-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/jumpcloud.com\/blog\/how-to-create-sudo-user-manage-sudo-access-ubuntu-22-04","title":{"rendered":"How to Create a New Sudo User & Manage Sudo Access on Ubuntu 22.04"},"content":{"rendered":"\n

Jump to Tutorial<\/a><\/p>\n\n\n\n

As a systems administrator, you may want to assign limited admin privileges to a delegated administrator so they can assist with administrative tasks. To help you accomplish this, the following tutorial will examine how to create a sudo user as well as manage sudo access on Ubuntu 22.04.<\/p>\n\n\n\n

What Is a Sudo User?<\/h2>\n\n\n\n

The root user, also known as the superuser, is the user with the highest privileges in a Linux system. The user has rights to execute virtually any command without restriction, including installing and uninstalling applications, modifying configuration files, adding and removing user accounts, upgrading the system, and creating and removing files, among other things.<\/p>\n\n\n\n

However, logging in and carrying out commands as root is highly discouraged. The fact that the root user can run any command on the system can also be risky. All it takes is one bad command to be executed and the whole system can be compromised. As such, it\u2019s always recommended to administer the Linux system as a sudo user.<\/p>\n\n\n\n

In Linux, sudo is a program that allows a regular user to run commands with root privileges or permissions. Sudo stands for either \u201csuper user do\u201d or \u201csubstitute user do.\u201d A sudo user is a regular user that can run some commands as a root user or with root privileges. <\/p>\n\n\n\n

Ideally, a sudo user is granted just enough privileges to allow them to perform the tasks at hand. This is known as the least privilege principle<\/a>, which is particularly important if you are granting sudo privileges to multiple users. They should only be granted the minimum rights or permissions needed to perform their role. <\/p>\n\n\n\n

How to Create a Sudo User<\/h2>\n\n\n\n

Now that you know why a sudo user is essential on a Linux system, let\u2019s create and configure a sudo user on Ubuntu 22.04.<\/p>\n\n\n\n

Step 1: Log in to your server<\/h3>\n\n\n\n

To get started, log into your Ubuntu 22.04 server instance as the root user with the following SSH command:<\/p>\n\n\n\n

$ ssh root@server-ip<\/code><\/p>\n\n\n\n

If you are using the Putty SSH client, simply type in your server\u2019s IP address as indicated and click Open<\/strong>.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

When prompted, provide the root password and hit ENTER. Once successfully logged in, you will land on the shell of your server instance.<\/p>\n\n\n\n

Step 2: Create a new user<\/h3>\n\n\n\n

To create a sudo user, you will first create a new login user and later make the user a sudo user.<\/p>\n\n\n\n

To add or create a new user, run the adduser<\/strong> command as follows. In this example, we are creating a new regular user called jumpcloud<\/strong>.<\/p>\n\n\n\n

# adduser jumpcloud<\/code><\/p>\n\n\n\n

The following happens when you run this command:<\/p>\n\n\n\n