Configuring sudo access
for administrative tasks151
Sometimes, you want to have an interactive session so that there is no need to type sudo again and again. For that, the i option is really useful. Let’s try it:
[user@rhel-instance
]$ sudo -i[sudo] password for user:[root@rhel-instance
]#Let’s now move onto customizing the configuration of sudo in the sudoers file.
Configuring sudoersWe have seen the details of the default /etc/sudoers file in the previous section. Let’s see a couple of examples of how to make a more granular configuration.
Let’s start by making sudo run admin commands without requesting a password for the users in the wheel group. We can run visudo and make the line that starts with wheel look as follows:
%wheel ALL=(ALL) NOPASSWD: ALL
Save it. Note that there is a commented line in the configuration file with that configuration. Now, let’s try it:
Share with your friends: