Blogs Classifieds Downloads FlashChat Gallery Googlemap Invite Friends Links Projects Reviews Wiki
 


Our Sponsors
Want to advertise?  


Reply
 
LinkBack Thread Tools
  #1  
Old January 29th, 2010
dthacker's Avatar
dthacker Offline
Cat Herder and Penguin Wrangler
 
Join Date: June 2006
Location: Omaha, Nebraska USA
Posts: 99
Send a message via Yahoo to dthacker
Problems using sudo in AIX 5.3

I'm using sudo from the
pWare - AIX Open Source software for IBM AIX 5.3 and 6.1
site.
Here's what I'm trying to do.
I have a power user called "rtkprd" that several people now use. I want stop all logins with this user id, and force the users to login under their own id, then sudo to rtkprd. For example, I would log into the system as "thackerd" and then sudo to "rtkprd" to run the privileged commands.

My /etc/sudoers file has only a few lines at this point. It looks like this:
Code:
#Defaults
Defaults logfile=/var/log/sudo


#User privilege specification
root    ALL=(ALL)  ALL
thackerd  ALL = (rtkprd) ALL
I'm expecting to be able to login as thackerd, then "sudo -i rtkprd" to get rtkprd's powers. Instead I'm getting this error:

Code:
/home/thackerd> sudo -i rtkprd

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
Sorry, user thackerd is not allowed to execute '/usr/bin/ksh rtkprd' as root on rtkdev.mydomain.local.
How can I fix this?

Thanks in Advance!
Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old January 29th, 2010
ross.mather's Avatar
ross.mather Offline
Senior Member
 
Join Date: January 2007
Location: Nomadic in the UK
Posts: 574
Re: Problems using sudo in AIX 5.3

I've done this several ways, the specific error means you need to enable:

thackerd ALL = (rtkprd) /usr/bin/ksh

You could also create a group to access this:

%access_trk = (rtkprd) /usr/bin/ksh

And add all the relevant users to the group.

I've also done this by enabling su - rtkprd as a root action for the specific users.
__________________
Ross Mather, IBM AIX IT Specialist.
That said anything I say here is my own opinion and not anything that you can ever hold against IBM.
Ohhh and don't forget that I make mistakes too....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old February 1st, 2010
dthacker's Avatar
dthacker Offline
Cat Herder and Penguin Wrangler
 
Join Date: June 2006
Location: Omaha, Nebraska USA
Posts: 99
Send a message via Yahoo to dthacker
Re: Problems using sudo in AIX 5.3

I don't think we've got the recipe yet. I've created a little shell script called /usr/local/bin/only_rtkprd.sh. I've set the mode on it to 700.

Then I simplified my /etc/sudoers file like this:
Code:
 
Defaults logfile=/var/log/sudo
root    ALL = (ALL) ALL
thackerd        ALL = (rtkprd)  /usr/local/bin/only_rtkprd.sh
And I tried to run the script by using sudo:
Code:
 
/home/thackerd> id
uid=516(thackerd) gid=1(staff) groups=206(rtkprd)
/home/thackerd> sudo /usr/local/bin/only_rtkprd.sh
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.
Password:
Sorry, user thackerd is not allowed to execute '/usr/local/bin/only_rtkprd.sh' as root on rtkdev.mydomain.local.
Same problem, can't execute the script and AIX thinks I'm trying to execute as root. That really baffles me because I've got (rtkprd) for the user that the script should be run as.

I also tried this with the %groupname approach. My user id is a member of the group "rtkprd" (see screenshot above) I tried this setup in /etc/sudoers:
Code:
 
#Defaults
Defaults logfile=/var/log/sudo
root    ALL = (ALL) ALL
%rtkprd ALL = (rtkprd)          /usr/local/bin/only_rtkprd.sh
I get the same error message. Again, why does sudo or AIX think I'm trying to execute as root?

I'm baffled.

Dave
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old February 3rd, 2010
j.gann's Avatar
j.gann Offline
Unix Specialist
 
Join Date: November 2008
Location: Switzerland
Posts: 14
Re: Problems using sudo in AIX 5.3

look at sudo's -u option
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
aix, problems, sudo

These are the 100 most searched terms
Search Cloud
0042-001 0042-001 nim 0042-008 nimsh: request denied 0513-001 the system resource controller daemon is not active 0513-001 the system resource controller daemon is not active. 0514-061 0514-061 cannot find a child device 0514-061 cannot find a child device. 0516-787 0516-787 extendlv 0516-787 extendlv: maximum allocation for logical volume 110000ac 3074feb7 aa00e1f3 aio aix aix aio aix freeware aix memory usage aix rsync aixif_arp_dup_addr b150f22a b181f22a b181fb53 ba010004 c1001020 d133c002 dacnone dcb47997 fcp_array_err6 fget_config gnu tar aix gtar aix hmc root password hmc vmware ibm p6 520 libpopt.a libpopt.a(libpopt.so.0) is needed by rsync-2.6.2-1 migratelv mksysb navisphere agent nim server pseriestech ptype and account type do not match rshd: 0826-813 permission is denied. rsync aix sc_disk_err4 scan_error_chrp vio server vmware hmc websm ... powered by Simple Search Cloud


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Powered by vbWiki Pro 1.3 RC5. Copyright ©2006-2007, NuHit, LLC

vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73