Yes when you su to root make sure you inclued a ' -' that's a <space> and a hyphen after su.. to ensure you get the environment of hte user you are switching to..
su -
Quote:
It is advisable that administrative users, as well as any other users that are authorized to use su (of which there should be very few, if any), acquire the habit of always following the su command with a space and then a hyphen. The hyphen has two effects: (1) it switches the current directory to the home directory of the new user (e.g., to /root in the case of the root user) and (2) it changes the environmental variables to those of the new user. That is, if the first argument to su is a hyphen, the current directory and environment will be changed to what would be expected if the new user had actually logged on to a new session (rather than just taking over an existing session).
|
http://www.linfo.org/su.html
To verify the difference for yourself first su to root as you normally do. then issue the command
echo $PATH
Exit back to your normal user then
su - to root, and again issue the command
echo $PATH I think you will notice the Environment PATH is a little different.