On CentOS 7, I installed some executables in /opt/app-version/bin/executable
. Those executables have the following permissions:
rwxrwxr-x. 500 500
Ownership of every directory in the path /opt/app-version/bin/
is 500 500
--except /opt
, which is root root
.
My first question: what is this 500 500
business? Given that I installed the executables using sudo
, shouldn't the owner and group be root
?
I've run the following command as root to create symbolic links to the executables in /usr/local/bin/
:
ln /opt/app-version/bin/executable /usr/local/bin/executable --symbolic
I am able to run executable
from the command line as a regular user, but not as a regular user using sudo
.
Running sudo executable
returns sh: executable: command not found
.
Running sudo echo $PATH
shows that /usr/local/bin/
is in $PATH
for sudo environments. ( Or does it? Am I seeing the contents of $PATH
for the super user environment, or $PATH
for the environment of the user that called sudo
? Does CentOS create a new environment for commands run with sudo
, or does it just run the command in the caller's environment? )
Running sudo ls -la /usr/local/bin/executable
returns a listing for executable
in /usr/local/bin/
with ownership lrwxrwxrwx. 1 root root
. ( Does ln --symbolic
really create globally editable links by default? Isn't that--a horrible idea? ) My understanding is that this shows sudo
should be able to run executable
.
What am I missing?