[TriLUG] OT: sudo runas different user

Peter Neilson neilson at windstream.net
Wed Apr 24 18:55:32 EDT 2013


I use su, not sudo. thusly:

myname at mysys:~$ su diffname
Password:
diffname at mysys:/home/myname$ cd
diffname at mysys:~$

Or even more thusly:

myname at mysys:~$ su -l diffname
Password:
diffname at mysys:~$

If you intend to work without knowing the different user's password, then  
sudo bash beforehand, and run the su command from the root prompt.


On Wed, 24 Apr 2013 17:50:42 -0400, Matthew Opoka <matthew at opoka.name>  
wrote:

> All,
>
> I'm trying to run a list of commands in sudo as a different user.  That  
> part I have working but I can't get sudo to run the commands with the  
> target user's gnarlyenviroment.  Any ideas on the best way to do this?
>
> Regards,
>
> Matthew



More information about the TriLUG mailing list