You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

How to Configure SUDO To Allow Non-Root Users to Run Privileged Commands

edited Nov 9, 2022 9:04AM in Linux

The "sudo" command is used to allow non-root users to run commands that require root privileges. You can configure sudo to allow a user to run all commands in the same way as the root user, or you can configure it to allow a user to run specific commands with root privileges.

To configure sudo, log in to your linux system as the root user and open file "/etc/sudoers" using the following command, which will allow you to edit the sudoers file:

# visudo

The following are examples from the sudoers file. A specific host name can be set for each entry in the sudoers file. This can be needed if there is a global sudoers file pushed out from a central configuration management tool to multiple different hosts, and where some users are configured to have sudo privileges on a specific host (or group of hosts) rather than for all hosts. In the following examples, ‘server1’ is used as an example of a sudoers file entry being set for a specific host only:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!