Question: Question:
I am using CentOS.
When I became root, I tried to execute the command installed in /usr/local/bin
, but the PATH was not in the initial state.
I think it's related to security, but for some reason I didn't put PATH in /usr/local/bin
. If you know this, please teach me.
Answer: Answer:
If you leave CentOS and talk about commercial UNIX
/usr/bin
and /bin
are provided by the vendor = software whose operation is guaranteed by the vendor is included.
/usr/local/bin
contains stray builds (software compiled by the user).
(He said that HP-UX is completely configured and operated like that.
It is impossible to install only the executable format of the software provided in binary)
Only software guaranteed by the vendor can be started as root
provided by the vendor.
So it seems that it is better not to include /usr/local/bin
in the root
PATH
.
I've heard that security-friendly root
should type /bin/ls
even when starting ls
(to never start malicious ls
).
If you have to use the software in /usr/local/bin
as root
, you should be aware of it and hit the full path.