Quote:
Originally Posted by
paqman
I have a coworker that has set up some funky aliases in /etc/bash.alias, and he insists on leaving them that way.
First off: if they are
his aliases and are not necessary for the working of the system as a whole they have no business being there. They should go to
his profile, rc-script or whatever he uses to configure
his session. I would make that absolutely clear to him in your position.
This is something that always put me off on Linux systems: instead of putting what is absolutely necessary into the
systems configuration and letting everybody take it from there Linux distributions have usually some guy force what he thinks is fine onto the whole world.
Quote:
Originally Posted by
paqman
Anyway, I was wondering if there were a way for me to sudo to root without reading /etc/bash.alias, or maybe have it re-source my personal .bashrc file after I sudo to root?
Using sudo you can find out "where you came from", that is: which user you used to switch into that UID. This way you could set up some mechanism which one (out of several) configurations to apply, as RudiC already hinted at. (Again: only, if
his configuration is not mixed up with the
systems configuration, so no putting what belongs to
/home/<someuser>/.bashrc into
/etc/bashrc (or similarily general configuration scripts.)
Second: you can use the "SETENV:" and "NOSETENV:" directives in
/etc/sudoers and their respective commandline equivalents ("-E", etc.) for
sudo.
I hope this helps.
bakunin