I'm running OpenSuse 12.1 KDE. I was previously running Ubuntu. In Ubuntu there was a superuser option (sudo -s
) that preserved the original user's HOME
env var (and another option, sudo -i
, that set the target user's HOME
env var).
I want to have the same functionality in OpenSuse. However, by default every variation of su
or sudo
that I have tried sets the HOME
env var to the target user's value.
Can anyone give me the precise steps for implementing one variation (I.e., an alias or something) of either su
or sudo
that will do the following:
- preserve the original user's
HOME
env var - combine the original user's
PATH
env var with the target user'sPATH
env var - otherwise, work similarly to
sudo -s
in Ubuntu orsu
in OpenSuse.
I prefer to change as little about the default config as possible, and I would hope to come up with a script that will implement this minor change so that when I upgrade, I can restore my configuration with minimal disruption/effort.