•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Infrastructure
      • iColocation
    • Compute
      • cMetal
      • cVirtual
    • Storage
      • sObject
      • sBlock
    • Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • Protection
      • pBackup
      • pDDoS
  •  Solutions
    • Ecommerce
    • Finance
    • Gaming
    • Hosting
    • Management
    • Security
    • System Integrator
  •  Support
    • Community
    • Knowledge Base
    • Open A Ticket
  •  USA & Canada: 800-933-1517
  •  International: 626-549-2801
  •  Email: sales@psychz.net
  • Services
    • new-colocation-header-img
      Infrastructure
      • iColocation
    • new-compute-header-img
      Compute
      • cMetal
      • cVirtual
    • new-storage-header-img
      Storage
      • sObject
      • sBlock
    • new-networking-header-img
      Networking
      • nCDN
      • nIP Transit
      • nWavelength
    • new-protection-header-img
      Protection
      • pBackup
      • pDDoS
  • Solutions
    • Ecommerce
    • Security
    • Gaming
    • Hosting
    • Management
    • Finance
    • System Integrator
  • Dashboard

Add user to sudoers Centos

  • Home
  • Client
  • Qa Forum
  • Add user to sudoers Centos

Posted By: Jon | 1 Replies | Last Reply On: Oct 08, 2017 23:07:10

How to add a user to sudoers in Centos? 

Psychz - Maya

Votes: 0Posted On: Oct 08, 2017 23:07:10
 

When you want to grant Admin privileges to normal users. These privileges are only assigned to "root" users but there can be a situation when you want to give them to normal users as well. 'sudo' command provides a mechanism to do so.
 
The following steps show you how to add a user to sudo user.

Prerequisites

1. Operating System - CentOS 7

 
Step 1

Use the 'usermod' command to add the user to the 'wheel' group. By default, on CentOS, members of the wheel group have sudo privileges.
 
usermod -aG wheel mercury  (where 'mercury' is an existing user)

 
Step 2

Test the account for sudo access

Switch to the account you just assigned 'sudo' access to using 'su' command
 
su - mercury
 
 
Now, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges.
For example, you can list the contents of the /root directory, which is normally only accessible to the root user.
 
mercury$ sudo ls -la /root
 
You will be prompted for the password of the user account if this is your first use of 'sudo' in a session. Enter the password to proceed.

 

Output 

[sudo] password for username:
 
If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.

Was this reply helpful?

Related topics

  • Cómo agregar usuarios a sudoers?
  • Centos - Añadir usuario al grupo
  • CentOS 7: "CALL IT RED HAT 7 LITE"
  • ¿Es posible añadir más hardware para los servidores de colocación. ¿Si es así, cómo?
  • How to change user password in Linux?
  • Cómo establecer o cambiar las contraseñas de usuario con ldappasswd?
  • Setup VPN on CentOS 8
  • Yum Update Not Working on Centos 7
  • Upgrade Centos 6 to Centos 7
  • Lo más paneles de control de alojamiento para Linux
  • Installation of Lamp Stack on CentOS 7
  • sBlock - Backup on RHEL, CentOS, AlmaLinux & Rocky Linux
  • CDN and Load Balancer: Ultimate combination for efficient content delivery
  • EasyApache 4: mejor que nunca?
  • CDN Hosting and why Every website should utilize a CDN
Copyright © 2025 Psychz Networks,
A Profuse Solutions Inc Company
Hosting Services
Infrastructure
  • iColocation
Compute
  • cMetal
  • cVirtual
Storage
  • sObject
  • sBlock
Networking
  • nCDN
  • nIP Transit
  • nWavelength
Protection
  • pBackup
  • pDDoS
Company
  • About Us
  • Blog
  • Careers
  • Contact Us
  • Data Centers
  • Looking Glass
  • Network
  • Reseller
Policies
  • Acceptable Usage Policy
  • Privacy Policy
  • Service Level Agreement
  • Terms and Conditions
Support
  • Community
  • Knowledge Base
  • Open A Ticket
Get In Touch
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801