DSL Ideas and Suggestions :: /opt/bin in root's PATH
dsl@box:~$ su - root
Password:
root@ttyp0[root]# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/opt/bin:.
root@ttyp0[root]#
Looks like /opt/bin is there to me.
What root access/login procedure is being attempted?
PATH is set when a login shell happens - if it isn't a login shell, profile won't be sourced.
I believe most distros have root's PATH set differently anyways.
dsl@box:~$ sudo su
bash-2.05b# echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/bin/X11:/usr/local/sbin:/usr/local/bin
I see your point, hats....hadn't thought about that.
another variation...
dsl@box:~$ sudo echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/games:/opt/bin:.:.
Right, so you'd want to use sudo su -
Ah, helpful replies guys, thx. On most distros it's the ordinary user's PATH that's more restricted than root's. dsl has a non-login root shell, but it's still root.
I noticed this because /opt/bin isn't in PATH when I open a root shell from the right-click menu (I only rarely type su - on dsl) and it might be useful if binaries linked into /opt/bin could be found from any type of root shell, just like binaries in /bin whatever, hence found by other apps running as root that look in PATH.
Root should be able to find anything in PATH that user dsl can, yes?
Next Page...
original here.