[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

su wrapper on radmind server

There is a problem with "su -m" in that it does not change $HOME, which results in your own .bashrc being sourced instead of ~radmind/.bashrc. This is why ~/bin was not in the path. In order to get the desired behavior from su I had to write a wrapper.

When the wrapper is invoked with a single argument (target user) it will su to that user using "su -m" and will source the .bashrc in that user's home directory. Any other invocation of su, including using any options (e.g. -l or -m) will result in a pass through to su with no changes.

So, in order to su to the radmind user you should just type:

su radmind

I have aliased su to the wrapper in the global bash config (/etc/ profile).