Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUDO to wasadmin minus some commands

Status
Not open for further replies.

kjsys1

MIS
Jan 14, 2003
14
US
We running AIX 5.3, I want to allow a few users to sudo to wasadmin (and wasadmin owns everything under "/usr/WebSphere/AppServer"), yet I do want them to be able to update certain config files in that filesystem, is there a way to set that up in the sudoers file?
 
You have to be careful. At first sight something like
Code:
%someusers myhost = (wasadmin)  /usr/bin/vi /usr/WebSphere/AppServer/config_file
seems to fit the bill but the users can beak out of vi into a shell which is not what you want.

How about giving the users the ability to edit /tmp/config_file and then adding the line
Code:
%someusers myhost = (wasadmin)  /usr/bin/cp /tmp/config_file %someusers myhost = (wasadmin)  /usr/bin
or, better still, write a script which does
Code:
cp /usr/WebSphere/AppServer/config_file /usr/WebSphere/AppServer/config_file.$(date +%y%m%d_%H%M)
cp /tmp/config_file /usr/WebSphere/AppServer/config_file
and allow the users to run that under sudo.

Ceci n'est pas une signature
Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top