Help required to setup sudoers file
Hi,
This is my scenario - There're 7 users who should be able to bring up and bring down the application. The users will basically login with their user IDs, su to a common account and execute the startup/shutdown commands from there. They should not be prompted for the password. I'm having trouble carrying this out. Whatever I've tried, I'm being prompted to enter the password. |
Code:
user_login host_name = (as_user) NOPASSWD: commands Code:
%group_name host_name = (as_user) NOPASSWD: commands Code:
%adm ALL = (ALL) NOPASSWD: /sbin/shutdown -h now, reboot |
This is my sudoers file:
Code:
User_Alias B24GRP = b24adm |
B24GRP looks like group name. should be %B24GRP
Is b24prd priveleged user? Code:
sudo -u b24prd command |
The sudoers file was fine. The issue was due to the way 'sudo' was used in the script.
sudoers file now is, Code:
b24adm ALL = (b24prd) NOPASSWD : ALL Code:
su - b24prd <<EOF Now, I've included the commands in a separate command.ksh file and use sudo in the script as: Code:
sudo -u b24prd -i command.ksh |
All times are GMT -5. The time now is 09:56 PM. |