'su' without password

Smoot Carl-Mitchell smoot at tic.com
Thu Feb 19 16:32:37 UTC 2009


On Thu, 2009-02-19 at 06:28 +0100, Pol wrote:
> Smoot Carl-Mitchell wrote:
> > On Wed, 2009-02-18 at 12:58 +0100, Pol wrote:
> >> How to let user1 'su' user2, without entering password?
> > Then user1 can run a command as user2 by typing:
> > 
> > sudo -u user2 command args ...
> 
> It seems that 'command' does not get the environment of the user2, this way.

That is correct.  If you want to become user2 completely, you can do:

sudo -u user2 -i

which will give you a shell with user2's environment.  Any command typed
at that point will be with respect to user2's environment settings.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list