File in /usr/local/bin can't be seen by some users
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm installing Wordpress CLI from the official instructions, logged in as a user with sudo permissions on a VPS, Centos Server with cloud linux:
Download the WP-CLI tool from Github with the following command:
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Confirm that it has downloaded successfully with this command:
$ php wp-cli.phar --info
Now you need to set wp-cli.phar to be an executable file. Type:
$ chmod +x wp-cli.phar
To finalize the installation, move WP-CLI into its final location:
$ sudo mv wp-cli.phar /usr/local/bin/wp
All worked well, wp-cli works from there.
But when I log out and back in as a different user, I get wp: command not found
If I do cd /usr/local/bin
then ls
I can see some files but not wp. What do I need to do so this user can see and use wp?
UPDATE:
Having run cat /etc/passwd
as suggested, here is the output:
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
mailman:x:32006:32006
::/usr/local/cpanel/3rdparty/mailman:/usr/local/cpanel/bin/noshell
mailnull:x:47:47:Exim:/var/spool/mqueue:/bin/false
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Nobody:/:/sbin/nologin
mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash
cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell
linux centos users
add a comment |Â
up vote
0
down vote
favorite
I'm installing Wordpress CLI from the official instructions, logged in as a user with sudo permissions on a VPS, Centos Server with cloud linux:
Download the WP-CLI tool from Github with the following command:
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Confirm that it has downloaded successfully with this command:
$ php wp-cli.phar --info
Now you need to set wp-cli.phar to be an executable file. Type:
$ chmod +x wp-cli.phar
To finalize the installation, move WP-CLI into its final location:
$ sudo mv wp-cli.phar /usr/local/bin/wp
All worked well, wp-cli works from there.
But when I log out and back in as a different user, I get wp: command not found
If I do cd /usr/local/bin
then ls
I can see some files but not wp. What do I need to do so this user can see and use wp?
UPDATE:
Having run cat /etc/passwd
as suggested, here is the output:
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
mailman:x:32006:32006
::/usr/local/cpanel/3rdparty/mailman:/usr/local/cpanel/bin/noshell
mailnull:x:47:47:Exim:/var/spool/mqueue:/bin/false
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Nobody:/:/sbin/nologin
mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash
cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell
linux centos users
1
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same/usr/local/bin
.
â Ulrich Schwarz
Feb 7 at 19:36
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm installing Wordpress CLI from the official instructions, logged in as a user with sudo permissions on a VPS, Centos Server with cloud linux:
Download the WP-CLI tool from Github with the following command:
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Confirm that it has downloaded successfully with this command:
$ php wp-cli.phar --info
Now you need to set wp-cli.phar to be an executable file. Type:
$ chmod +x wp-cli.phar
To finalize the installation, move WP-CLI into its final location:
$ sudo mv wp-cli.phar /usr/local/bin/wp
All worked well, wp-cli works from there.
But when I log out and back in as a different user, I get wp: command not found
If I do cd /usr/local/bin
then ls
I can see some files but not wp. What do I need to do so this user can see and use wp?
UPDATE:
Having run cat /etc/passwd
as suggested, here is the output:
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
mailman:x:32006:32006
::/usr/local/cpanel/3rdparty/mailman:/usr/local/cpanel/bin/noshell
mailnull:x:47:47:Exim:/var/spool/mqueue:/bin/false
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Nobody:/:/sbin/nologin
mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash
cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell
linux centos users
I'm installing Wordpress CLI from the official instructions, logged in as a user with sudo permissions on a VPS, Centos Server with cloud linux:
Download the WP-CLI tool from Github with the following command:
$ curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Confirm that it has downloaded successfully with this command:
$ php wp-cli.phar --info
Now you need to set wp-cli.phar to be an executable file. Type:
$ chmod +x wp-cli.phar
To finalize the installation, move WP-CLI into its final location:
$ sudo mv wp-cli.phar /usr/local/bin/wp
All worked well, wp-cli works from there.
But when I log out and back in as a different user, I get wp: command not found
If I do cd /usr/local/bin
then ls
I can see some files but not wp. What do I need to do so this user can see and use wp?
UPDATE:
Having run cat /etc/passwd
as suggested, here is the output:
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
vcsa:x:69:69:virtual console memory owner:/dev:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
dovecot:x:97:97:dovecot:/usr/libexec/dovecot:/sbin/nologin
nscd:x:28:28:NSCD Daemon:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
mailman:x:32006:32006
::/usr/local/cpanel/3rdparty/mailman:/usr/local/cpanel/bin/noshell
mailnull:x:47:47:Exim:/var/spool/mqueue:/bin/false
root:x:0:0:root:/root:/bin/bash
nobody:x:99:99:Nobody:/:/sbin/nologin
mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash
cpaneleximfilter:x:32007:32009::/var/cpanel/userhomes/cpaneleximfilter:/usr/local/cpanel/bin/noshell
linux centos users
edited Feb 7 at 21:51
Sparhawk
8,35863487
8,35863487
asked Feb 7 at 19:29
iain-g
112
112
1
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same/usr/local/bin
.
â Ulrich Schwarz
Feb 7 at 19:36
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52
add a comment |Â
1
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same/usr/local/bin
.
â Ulrich Schwarz
Feb 7 at 19:36
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52
1
1
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same
/usr/local/bin
.â Ulrich Schwarz
Feb 7 at 19:36
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same
/usr/local/bin
.â Ulrich Schwarz
Feb 7 at 19:36
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
1
down vote
OK, looks like Ulrich was on the right track with a jail, it was cagefs - I needed to add /usr/local/bin/wp
to binutils.cfg - found the answer here: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
OK, looks like Ulrich was on the right track with a jail, it was cagefs - I needed to add /usr/local/bin/wp
to binutils.cfg - found the answer here: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users
add a comment |Â
up vote
1
down vote
OK, looks like Ulrich was on the right track with a jail, it was cagefs - I needed to add /usr/local/bin/wp
to binutils.cfg - found the answer here: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users
add a comment |Â
up vote
1
down vote
up vote
1
down vote
OK, looks like Ulrich was on the right track with a jail, it was cagefs - I needed to add /usr/local/bin/wp
to binutils.cfg - found the answer here: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users
OK, looks like Ulrich was on the right track with a jail, it was cagefs - I needed to add /usr/local/bin/wp
to binutils.cfg - found the answer here: https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users
answered Feb 7 at 20:52
iain-g
112
112
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f422637%2ffile-in-usr-local-bin-cant-be-seen-by-some-users%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Is it still there when you come back as the original user? There is no selective listing of contents of a directory, permissions-wise, so my guess is maybe one of your users really is in a chroot jail or similar, which means they might not have the same
/usr/local/bin
.â Ulrich Schwarz
Feb 7 at 19:36
Yes still there, thereâÂÂs lots more files there when logged in as the user that installed it. Drush is in there too and thatâÂÂs visible to all users. How would I check the jail suggestion?
â iain-g
Feb 7 at 19:39
if you cat /etc/passwd to check on the other user, is there anything weird about the user that you are having issues with? like Ulrich said, do you see them in a jail? with a different shell? what are the permissions for that wp file you're trying to access?
â saleetzo
Feb 7 at 19:47
I did cat etc/passwd, not sure what I'm looking for, output's too long for a comment, I'll edit the question with that added, permissions are -rwxrwxr-x
â iain-g
Feb 7 at 19:52