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
HOMEenv var - combine the original user's
PATHenv var with the target user'sPATHenv var - otherwise, work similarly to
sudo -sin Ubuntu orsuin 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.