System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.™   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Grant sudo access in RHEL and CentOS

Last updated on:  2020-04-23

Authored by:  Chris Silva


This article provides the steps to grant an existing Linux® user sudo or administrative access on a RHEL® or CentOS® server.

Prerequisites

You need to have the following prerequisites:

  • A basic understanding of Secure Shell (SSH)
  • Sudo or administrative access to your server
  • A Cloud Server running distributions based on RHEL or CentOS

Grant sudo or administrative permissions in RHEL or CentOS

You can use the following method to grant an existing user sudo-level permissions on a default RHEL or CentOS system:

  1. On a RHEL or CentOS server, the default group wheel has sudo permissions. To add a user to this group and grant a user sudo permissions, run the following command:

    usermod -aG wheel

  2. Run the following command to verify that you added the user to the wheel group:

    id

If you added the user to the group successfully, you should see the wheel group listed in the groups section.

Modify the sudoers file

Another method of granting sudo permissions on a Linux server is to modify the /etc/sudoers file to include the desired user. This method provides direct control by the user rather than by adding a user to a group.

Warning: Editing the /etc/sudoers file might be destructive to the server, and the system might lock you out if there is any incorrect syntax in the file. Exercise caution when you modify this file.

To edit the /etc/sudoers file, we recommend that you use the visudo command.

After you open the file by using visudo, add the following line to the end of the file:

   <user> ALL=(ALL)		ALL

After you make the change, save and exit the file. This modification grants the user sudo permissions without adding the user to the wheel group.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.