Code Snippet

Just another Code Snippet site

[CentOS] Sudo

# Backup sudoers file and create tmp file

cp -f /etc/sudoers /etc/sudoers.tmp
cp -f /etc/sudoers /etc/sudoers.bak

add the following line in the sudoers.tmp (with %)

%GROUP_NAME  ALL=(ALL)       NOPASSWD: ALL

or

%USER_NAME  ALL=(ALL)       NOPASSWD: ALL

# Enable new sudoers file (tmp)

visudo -q -c -f /etc/sudoers.tmp && cp -f /etc/sudoers.tmp /etc/sudoers


One thought on “[CentOS] Sudo

Leave a Reply to Olivier Cancel reply

Your email address will not be published. Required fields are marked *