Sudoers doesn't work with User_Alias as expected.
Issue
- There is an user
realuserand the alias for the same isUSER_ALIAS_NEW. - The relevant part of file
/etc/sudoersis as follows:
User_Alias USER_ALIAS_NEW=realuser
root ALL=(ALL) ALL
Cmnd_Alias USER_CMDS = cp /tmp/sc-USER_ALIAS_NEW/new.pem /etc/somelocation/;
USER_ALIAS_NEW ALL = (root) NOPASSWD: USER_CMDS
- The command
cpneeds to run as root by userrealuser. - The actual command it needs to run is
cp /tmp/sc-realuser/new.pem /etc/somelocation/
Environment
- Red Hat Enterprise Linux (RHEL) 5, 6
sudoers
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
