•  Home
  •  Dashboard
  •  Company
    • About Us
    • Blog
    • Careers
    • Contact Us
    • Data Centers
    • Looking Glass
    • Network
    • Reseller
  •  Hosting Services
    • Backup
    • Content Delivery Network
    • Colocation Hosting
    • Dedicated Hosting
    • DDoS Mitigation
    • IP Transit
    • Private Cloud
    • Wavelength
  •  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
    • Dedicated Servers
    • Colocation
    • Private Cloud
    • DDos Protection
    • IP Transit
    • CDN
    • Backup
  • 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

  • How to add user to sudoers?
  • Centos - Add User To Group
  • CentOS 7: "CALL IT RED HAT 7 LITE"
  • Is it possible to add more hardware to the Colocation servers. If so how?
  • Setup VPN on CentOS 8
  • Yum Update Not Working on Centos 7
  • How to set or change user passwords with ldappasswd?
  • How to change user password in Linux?
  • Upgrade Centos 6 to Centos 7
  • Installation of Lamp Stack on CentOS 7
  • Top Hosting Control Panels For Linux
  • Firewalld commands for CentOS 7 and CentOS 8
  • EasyApache 4: better than ever?
  • Open Source Proxy Server Solutions
  • In Comparison: FreeBSD VS Linux
Hosting Services
  • Dedicated Hosting
  • Colocation Hosting
  • Backup
  • IP Transit
  • DDoS Mitigation
Support
  • Portal Login
  • Knowledgebase
  • Community
Company
  • About Us
  • Contact Us
  • Network
  • Data Centers
  • Looking Glass
  • Affiliates
  • Reseller
  • Blog
Policies
  • Privacy Policy
  • Acceptable Usage Policy
  • Terms and Conditions
  • Service Level Agreement
Company
  • Psychz Networks,
    A Profuse Solutions Company
    611 Wilshire Blvd #300
    Los Angeles,California 90017
    USA
  • US/Canada: 800-933-1517
  • International: 626-549-2801
Subscribe to Our Mailing List
* indicates required
Copyright © 2023 Psychz Networks, A Profuse Solutions Inc Company