File in /usr/local/bin can't be seen by some users

The name of the pictureThe name of the pictureThe name of the pictureClash 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






share|improve this question


















  • 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















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






share|improve this question


















  • 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













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






share|improve this question














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








share|improve this question













share|improve this question




share|improve this question








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













  • 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











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






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    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






























    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






    share|improve this answer
























      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






      share|improve this answer






















        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






        share|improve this answer












        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 7 at 20:52









        iain-g

        112




        112






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Displaying single band from multi-band raster using QGIS

            How many registers does an x86_64 CPU actually have?