Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I have my path when I su as root???

Status
Not open for further replies.

jd99

MIS
May 17, 2001
101
0
0
US
I used the line in my .profile path, made it executable, but it does nothing. :
PATH=/usr/ucb:/usr/ccs/bin:/opt/sfw/bin:$PATH
export PATH

What am I doing wrong. Basically my main goal is to have my path when I su as root without having to type the whole darn thing every time

Thanks,
Casey
 
U need to put that line (PATH=...) in /.profile, that's the root's profile..
 
I have it there. It works when I log in, but not when I su in.

Casey
 


try this.

1) edit the file su
# vi /etc/default/su

2) on line SUPATH, try to put the path that you want when you su.

note: if you su using the -, this will use you SUPATH and PATH.
ex. $ su - root

if not. just
ex. $ su root or $ su , it will use only your supath.

good luck.
 
Thats the answer I was looking for. Thanks a million.

Casey
 
You need to put the path in /etc/default/su file. This path will change your environment value in su.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top