LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices


Reply
  Search this Thread
Old 03-30-2010, 07:38 AM   #1
mufy
Member
 
Registered: Oct 2004
Location: Kuwait
Distribution: Currently - AIX | Previously - RHEL 4 ES, FC 10
Posts: 206
Blog Entries: 4

Rep: Reputation: 30
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.
 
Old 03-30-2010, 08:04 AM   #2
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
Code:
user_login host_name = (as_user) NOPASSWD: commands
or
Code:
%group_name host_name = (as_user) NOPASSWD: commands
e.g
Code:
%adm ALL = (ALL) NOPASSWD: /sbin/shutdown -h now, reboot

Last edited by troop; 03-30-2010 at 08:18 AM.
 
Old 03-30-2010, 08:18 AM   #3
mufy
Member
 
Registered: Oct 2004
Location: Kuwait
Distribution: Currently - AIX | Previously - RHEL 4 ES, FC 10
Posts: 206

Original Poster
Blog Entries: 4

Rep: Reputation: 30
This is my sudoers file:

Code:
User_Alias      B24GRP = b24adm
B24GRP  ALL = (b24prd) NOPASSWD : ALL
Is it wrong?
 
Old 03-30-2010, 10:17 PM   #4
troop
Member
 
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
B24GRP looks like group name. should be %B24GRP
Is b24prd priveleged user?
Code:
sudo -u b24prd command
shold work.

Last edited by troop; 03-30-2010 at 10:18 PM.
 
Old 03-31-2010, 07:59 AM   #5
mufy
Member
 
Registered: Oct 2004
Location: Kuwait
Distribution: Currently - AIX | Previously - RHEL 4 ES, FC 10
Posts: 206

Original Poster
Blog Entries: 4

Rep: Reputation: 30
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
Earlier, my script was:
Code:
su - b24prd <<EOF
. /<command1>
. /<command2>
. /<command3>
EOF
In the above, the script used to halt and prompt me for the password for b24prd.

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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help with sudoers file blancs Linux - Newbie 4 07-25-2008 05:42 PM
not in the sudoers file? underworld288 Slackware 3 06-18-2007 12:48 AM
help with sudoers file aarulan Linux - Newbie 4 03-26-2006 10:24 PM
I deleted /etc/sudoers and creates a new file call sudoers but now it doesnt for visu abefroman Linux - Software 1 11-10-2005 05:03 PM
sudoers file cactus-bob Linux - Newbie 2 03-11-2004 11:24 AM

LinuxQuestions.org > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 09:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration