How to Create Sudo User on Ubuntu

This article provides step-by-step setup guide for adding Sudo user to Ubuntu system.

The sudo command is designed to allow users to run programs with the security privileges of another user, by default the root user. In this guide we will show you how to create a new user with sudo privileges on Ubuntu.

Log in to your Ubuntu server as the root user.

Create a new user account using the useradd command.

# useradd username

Replace username with the user name that you want to create.

Use the passwd command to set a password for the new user.

# passwd username

You will be prompted to confirm the password. Make sure you use a strong password.

# Changing password for user username.
# New password:
# Retype new password:
# passwd: all authentication tokens updated successfully.

Add the new user to the sudo group.

# usermod -aG sudo username

READ ALSO: How to Use Sudo

  • 0 Пользователи нашли это полезным
Помог ли вам данный ответ?

Связанные статьи

How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS system. The sudo...

How to Use Sudo

This article provides a guide to using a Sudo user on CentOS server. From the command line,...

Set Server Time Zones with Timedatectl

This article provides a guide to setting the server time and server time zone settings using...

htaccess RewriteRule Examples

Here are some useful mod_rewrite RewriteRule redirect examples that you can use in your .htaccess...

Using htaccess File to Block IPs

If your webserver is Apache, you may block access to your website from specific IP addresses...