How to Configure SUDO To Allow Non-Root Users to Run Privileged Commands
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: