Add wp-cli to sub-cPanel accounts in WHM?
I have a vps on bluehost that's currently running whm on a centos. My main account has wp-cli installed. so when on SSH i can use commands "wp core download" etc. The problem is that none of the sub accounts (old or if newly created) have this ability. They say "-bash: wp: command not found."
Is there a way to turn wp-cli "on" for these other accounts?
-
What do you mean by sub cPanel accounts, Users created via the cPanel User Manager? Those users would not have SSH access. 0 -
From your root account: Move to tmp dir cd /tmp
Download WP-Clicurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Make it executable:chmod +x wp-cli.phar
Move it to /usr/local/binsudo mv wp-cli.phar /usr/local/bin/wp
If your users have a Jail Shell, they will be able to use the command0 -
While that advice is great for cPanel users @VM Creativo the original question was in regards to "subaccounts" which don't have SSH access. The only available subaccounts at this time are Email Users, Web Disk Users and FTP Users. 0 -
@cPanelLauren I might have used the incorrect language, but I don't think so. In WHM I create accounts, each of them is has their own individual cpanel. Only the main cpanel that was on my VPS has access to CLI. Each of those accounts can have ssh (jailed or normal). I think what @VM Creativo stated may be the answer to what I am trying to accomplish. I'll attempt and report back. 0 -
From your root account: Move to tmp dir
cd /tmp
Download WP-Clicurl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Make it executable:chmod +x wp-cli.phar
Move it to /usr/local/binsudo mv wp-cli.phar /usr/local/bin/wp
If your users have a Jail Shell, they will be able to use the command
This seemed to work perfectly. One quick question. So now that I did this, do I have 2 versions of cli on my system? One that was previously installed and this one? or did this over-write the old with just with new permissions?0 -
What do you mean by sub cPanel accounts, Users created via the cPanel User Manager? Those users would not have SSH access.
No i mean cpanel accounts created with WHM0 -
Hi @rudtek Ahhh!! Thanks for clarifying, subaccounts do imply something entirely different than the cPanel users. I'm glad to hear that @VM Creativos advice worked out for you!! 0 -
If you are using cloudlinux you may need to add: Next the path needs to be added to the cloud linux configuration file, you can do this by modifying the existing binunitls config file. edit '/etc/cagefs/conf.d/binutils.cfg' with a text editor of your choice such as vi or nano: nano /etc/cagefs/conf.d/binutils.cfg Add the following to the bottom of the file with the path using the path you chose in the move (mv) command above: [custom] comment=custom paths paths=/usr/local/bin/wp Next, we need cagefsctl to pick up the change by running the following command: cagefsctl --force-update You will see a number of files checked but you should see your path at the bottom as follows: 0
Please sign in to leave a comment.
Comments
8 comments