first question

Ladner, Eric (Eric.Ladner) Eric.Ladner at
Fri Jan 16 14:16:54 EST 2004

How about 

sudo su - target_user_name -c "/usr/target_user_home_dir/bin/cmd arg"


-----Original Message-----
From: sudo-users-bounces at [mailto:sudo-users-bounces at] On
Behalf Of Peter Lauda
Sent: Friday, January 16, 2004 12:56 PM
To: sudo-users at
Subject: first question

This e-mail was scanned when sent and was deemed virus free by ISVW SMB


I am trying to set up a sudoers file that will allow me to:

1. Invoke a command that normally runs as another user on a unix system.

2. Uses that users env in order to understand the required paths, etc,
the execution.

Here's an example of what I'm trying:

sudo -u target_user_name sh  -c /usr/target_user_home_dir/bin/cmd arg

I get:

Sorry, user my_user_name is not allowed to execute 'sudo -u 
target_user_name sh  -c /usr/target_user_home_dir/bin/cmd arg' as 
target_user_name on

I've read through the description of this in a faq, but when I set it up

and try to run it, I get a mesage that I am not allowed to exectute the 
cmd as the target user as above.

Any one have any tips or tricks for checking the sudoers file to see if 
I've missed something or got something wrong?

Any help greatly aprpeciated.



* To increase network security, TCCI, Inc. scans all outgoing
* messages with InterScan VirusWall from Trend Micro. We assume  *
* no liability for messages once they leave our network.

sudo-users mailing list <sudo-users at>
For list information, options, or to unsubscribe, visit:

More information about the sudo-users mailing list