Fwd: Another reason to prefer a real root over sudo

Rashkae ubuntu at tigershaunt.com
Thu Feb 5 14:47:49 UTC 2009


Pierre Frenkiel wrote:
> On Mon, 2 Feb 2009, Jeff Henson wrote:
> 
>> You should be able to use 'su -p username'. I'm at work and can't test
>> it right now though.
> 
>     thanks, it works ... but it just preserves the environment.
>     and curiously, "su - -p user" executes your .profile,
>     and not the user's one. A bug ?

No, not a bug, but exactly what you asked for with that combination of
options.  As you say, if you need to execute the login scripts *and*
maintain X, sux is better. (otherwise, you need to copy the .Xauthority
file from the old user's home direcoory to your own manually, which will
probably be impossible if you are su'ing to a user account rather than root.




More information about the ubuntu-users mailing list