Looking first at the 500 500
, if you restore from a tar
archive (among others) the owner and group will be preserved from the system where the archive was created: I'm guessing that the installer does this, and if the restored user or group does not exist on your system the numeric value is displayed.
Looking now at the PATH
, I have reproduced this on Ubuntu, and it seems that sudo
modifies PATH
: in your command sudo echo $PATH
the PATH
variable was expanded in the original shell before calling sudo
. There is a file /etc/sudoers
with an entry "defaults secure_path="..."
, and this seems to be what is used.
If you use sudo sh -c 'echo $PATH'
you will get a better idea of the PATH
being used. Note that I deliberately used sh
instead of bash
in order to bypass some of the initialisation files, which may change things, although sh
will of course have some of its own.
On Ubuntu, the secure_path
line does contain /user/local/bin
, but CentOS may be different (both are derived from Debian, but according to man sudoers
SELinux may override some entries). As far as I can see you have at least four options:-
- Modify
secure_path
to include `/usr/local/bin'. - Put the link into one of the directories defined in
secure_path
. - Use
su -c " "
instead ofsudo
. - Use
sudo -s
to get a rootbash
with the samePATH
initialisation as the original shell, then call your executable from there and exit afterwards.
I also found a lot of discussion and some other possible solutions here.