Runnign a command as a differen user using sudo
Posted on 2006-04-12
Hello , I am using sudo to grant a user to execute another userr's script as that user. This is my sudeors file:
# sudoers file.
# This file MUST be edited with the 'visudo' command as root.
# See the sudoers man page for the details on how to write a sudoers file.
# Host alias specification
#Host_Alias SUN = sunapp15
# User alias specification
User_Alias BEA_USERS = qa
# Cmnd alias specification
Cmnd_Alias CMMENU = \
Cmnd_Alias SU = /usr/bin/su
#Defaults:qa logfile=/usr/local/log/sudo.bea, runas_default=bea
# Runas alias specification
Runas_Alias BEA = bea
# User privilege specification
#root ALL=(ALL) ALL
#qaadmin ALL = (BEA) NOPASSWD: CMMENU
BEA_USERS ALL = (BEA) NOPASSWD: CMMENU, !SU
Two thing: first the NOPASSWD option doesn't work properly, Second when running a specific script, the log file ownership is root root. Doesn't it have to be owned by the Runas_Alias user? If not, is there a way to do that?
P.S. this is running on a solaris V.9