How to Create Sudo User on CentOS

This article provides step-by-step setup guide for adding Sudo user to CentOS 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 CentOS.

Log in to your CentOS 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 wheel group.

# usermod -aG wheel username

READ ALSO: How to Use Sudo

  • sudo
  • 5 Users Found This Useful
Was this answer helpful?

Related Articles

 View Server PHP Environment with phpinfo.php

The phpinfo() function outputs a huge amount of information about the system you're using, such...

 How to Change Root Password Using SSH

This article explains the method of changing the root password on a Linux Server using SSH....

 How to Use Sudo

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

 Import SSH Keys on CentOS 7 Server

This article provides a guide for importing SSH keys to CentOS 7 VPS server or Dedicated Server....

 Disable SELinux in CentOS 7

This article will provide the steps to disable SELinux in CentOS 7. SELinux is a security...

Powered by WHMCompleteSolution