I have a situation where I want the main admin user (with sudo for all) to have passwordless sudo as another user for one command. To my knowledge, that should give the following in /etc/sudoers:
ramo ALL=(otherUser) NOPASSWD: /usr/bin/command
ramo ALL=(ALL) ALL
But it seems like those two lines conflict, or the second overwrites the first. Any ideas on how to accomplish this?
Cheers
Ramo
EDIT: Turns out I slightly misunderstood how sudo works when specifying a user. I was under the impression that if you have ALL=(otherUser) then you didn't need to 'sudo -u otherUser' but could just sudo. This isn't the case.