• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Thursday, May 22, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home VPS/Servers management guides

How to create Sudo users in CentOS 7

How VPS by How VPS
November 2, 2018
in VPS/Servers management guides
0
0
SHARES
38
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Step 1 – Creating A New Sudo User
  3. Step 2 – Using Sudo in CentOS
  4. Conclusion
  5. Check out these top 3 Linux hosting services
    1. Was this article helpful?

Introduction

Sudo is the abbreviation of Super User Do. It is a command that enables programs to be implemented as a root user. Sudo runs commands provided to it with the privileges of a root user. It helps system administrators to grant specific users the permission to effectuate commands at the most powerful level (root level) without the need to log into the system as the root users.

This tutorial will help you create a unique user account in your CentOS system and grant it sudo privileges. It’ll also help you get started with sudo

Ready? Let’s get started!

Step 1 – Creating A New Sudo User

To create another  user in your CentOS  system, first run the command below to log into your server as a root user:

# ssh root@server_ip_address

Once you log in, execute the command below to create the new user:

# adduser hostadvice

The value hostadvice represents the name of the user you are about to create. Remember to replace this value with your desired username.

Next, execute the command below to set up the password for your newly created user:

# passwd hostadvice

This will give you a new output and you will be required to enter and retype the password for your new user. Make sure you have a strong password that combines letters, characters, and numbers.

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

Once you set up the password for this user, you can now execute the command below to add it to the CentOS wheel group.

# usermod -aG wheel username

By default, all users in the CentOS wheel group are given sudo access. For this reason, when you add the new user to the CentOS wheel group, you will automatically grant it sudo privileges.

Step 2 – Using Sudo in CentOS

By now, you have successfully created a new user and granted it sudo access. Next, you should grasp the basics to utilize sudo on CentOS with ease.

First, run the command below to  switch to your newly generated user:

$ su - hostadvice

Next, to utilize sudo you should prefix every command line with the sudo, followed by space. Run the command below to put the new user account to its first use:

$ sudo ls -l /root

Since this is the first instance you are using sudo on CentOS, you will get an output with the following message;

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for username:

Enter the password created in step one to continue. This will take you to the prompt of the newly created user. This prompt will be similar to:

[hostadvice@centos-s-1vcpu-1gb-tor1-01]$

If you want to execute any command as the root user, simply type exit and press ENTER, to exit the sudo account.

Conclusion

Congratulations! You have flawlessly created a new user and granted it sudo permissions on a CentOS server. If you want to create multiple sudo users on your Linux hosting (specifically, a VPS or dedicated server) follow all the steps for each user.

Remember to give a unique username and password for each user.

Check out these top 3 Linux hosting services

0

Was this article helpful?

Submit
Previous Post

SSL Certificates with Apache 2 on Fedora 14

Next Post

How to Sync Files/Directories Using Rsync with Non-standard SSH Port

Next Post

How to Sync Files/Directories Using Rsync with Non-standard SSH Port

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet