Escalating user privilege with sudo
In this recipe we will learn how to provide nominated users or groups the ability to execute a variety of commands with elevated privileges.
In a previous recipe we discovered how to create an administrative user that enables them to invoke the su
command. Given that this provides full access to root user functionalities, this may suit your needs, but for those who want a greater degree of flexibility, a solid audit trail, and the ability to provide a limited array of administrative capabilities to a select number of trusted users, you have come to the right place. It is the purpose of this recipe to show you how to activate and configure the sudo
(or superuser do) command.
Getting ready
To complete this recipe you will require a minimal installation of the CentOS 6 operating system with root privileges and a console-based text editor of your choice. It is assumed that your server maintains one or more users who qualify for this escalation in powers.