LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Sudo path variable error (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-path-variable-error-810816/)

andrewbonney 05-28-2010 05:23 PM

Sudo path variable error
 
Hi,
I'm having a strange issue with the PATH variable when running the command 'sudo su'. When executing this command the PATH variable changes. No problems there, but it changes to:

Code:

/usr/kerberos/sbin:/usr/kerberos/bin://sbin://bin:/usr/bin:/bin
Looking at this, there are two weird entries (//sbin and //bin) which should both start '/usr' instead. I'm not sure how I've managed to change this, or how a piece of software I'm using has done it (more likely it was me I expect), but could anyone suggest which file to look in to correct it? If it makes a difference the machine is running CentOS 5.

Cheers,
Andrew

mac.tieu 05-28-2010 09:29 PM

Quote:

Originally Posted by andrewbonney (Post 3984731)
Hi,
I'm having a strange issue with the PATH variable when running the command 'sudo su'. When executing this command the PATH variable changes. No problems there, but it changes to:

Code:

/usr/kerberos/sbin:/usr/kerberos/bin://sbin://bin:/usr/bin:/bin
Looking at this, there are two weird entries (//sbin and //bin) which should both start '/usr' instead. I'm not sure how I've managed to change this, or how a piece of software I'm using has done it (more likely it was me I expect), but could anyone suggest which file to look in to correct it? If it makes a difference the machine is running CentOS 5.

Cheers,
Andrew

Try out 'sudo su -' which reset all environment variables for su session.

MT.

andrewbonney 05-29-2010 03:07 AM

Yes, that works, but it only seems to hold for the current session. Is there any way to make it more permanent?


All times are GMT -5. The time now is 04:32 PM.