[X-Unix] sudo -s behavior changed in 10.5?

Phillip Burk philburk at mac.com
Thu Feb 21 06:03:50 PST 2008


This should probably be filed under the "stupid questions" section of  
the list but I've noticed that the behavior of sudo changed from 10.4  
to 10.5.  I can start a root shell session in Tiger via sudo -s and  
get all of the custom aliases and the custom prompt via /etc/bashrc.   
But in Leopard a sudo -s command resets the environment, i.e., there  
are no custom aliases and a generic default prompt.  Not exactly  
conducive for my productivity as I'm rolling out more and more 10.5  
clients into our client base.  For the record, I'm aware that sudo -i  
will keep the environment as it did in Tiger but the working directory  
isn't maintained, it's changed to the root home.  That's a PITA as  
well.  I just want the old behavior back and I don't know how to get it.

Things I've tried (lump-headed as they may have been):

1.  Adding ~/.profile to /var/root.
2.  Editing /etc/sudoers (it has changed from 10.4, I thought that  
perhaps the env_reset default option was doing it)
3.  Editing /etc/profile as well as /etc/bashrc (I know, no lectures  
here, I'm desperate).
4.  Endless amounts of googling.

Any advice?  Thanks. 


More information about the X-Unix mailing list