# File : sudo_to_some_users_with_some_commands # By : Maarten.deboer@Atos.net, 191010. 250403 # Subject : sudoers file for switching to some specific users # Cmnd_Alias MAIL = /bin/tail * /var/log/maillog ,\ /bin/journalctl -xe Cmnd_Alias HTTPD = /bin/journalctl -xe, \ /bin/tail * /var/log/httpd/access_log ,\ /bin/tail * /var/log/httpd/error_log Cmnd_Alias NETWORK = /usr/bin/traceroute -I Cmnd_Alias SELINUX = /sbin/setenforce Permissive, \ /bin/chcon -R -t httpd_sys_content_t /var/www/* ,\ /bin/chcon -R -t httpd_sys_content_t /appl/netapp/html/* Cmnd_Alias HOSTS = /bin/cp /etc/hosts /etc/hosts_*, \ /usr/bin/sudoedit /etc/hosts # ALL can switch to user autosupport ALL ALL=NOPASSWD: /usr/bin/su - autosupport autosupport ALL=NOPASSWD:MAIL autosupport ALL=NOPASSWD:HTTPD autosupport ALL=NOPASSWD:NETWORK autosupport ALL=NOPASSWD:SELINUX # # ALL can switch to user applafsp #ALL ALL=NOPASSWD: /usr/bin/su - applafsp applafsp ALL=NOPASSWD:MAIL applafsp ALL=NOPASSWD:HTTPD # # ALL can switch to user netapp ALL ALL=NOPASSWD: /usr/bin/su - netapp # nl19471 ALL=NOPASSWD:NETWORK # nl19471 ALL=NOPASSWD:SELINUX # nl19471 ALL=NOPASSWD:HOSTS