LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   how to change 'su' path (https://www.linuxquestions.org/questions/slackware-14/how-to-change-su-path-150817/)

danahata 02-26-2004 12:49 PM

how to change 'su' path
 
How do you change the PATH you get when you type just 'su' (not 'su -').

I've tried /etc/profile and /etc/rc.d/rc.K , and neither work.

Seems simple, but I can't find the answer anywhere.

Dana

bnice 02-26-2004 12:57 PM

`man su`
<snip>
The current environment is passed to the new shell. The value of $PATH is reset to
/bin:/usr/bin for normal users, or /sbin:/bin:/usr/sbin:/usr/bin for the super user.
This may be changed with the ENV_PATH and ENV_SUPATH definitions in /etc/login.defs.

synaptical 02-26-2004 01:01 PM

do you mean the actual PATH, or the directory you are in when you su to root?

druuna 02-26-2004 01:05 PM

Are you talking about adding something to the default PATH environment, or change the default itself?

Adding to the default can be done by editing (creating) /root/.bashrc.

The default PATH environments are set in /etc/login.defs. I would suggest not changing these, unless you realy know what you are doing.

Hope this helps.

danahata 02-26-2004 01:09 PM

/etc/login.defs worked

Thanks


All times are GMT -5. The time now is 02:29 PM.