Add wp-cli to sub-cPanel accounts in WHM?

rudtek

Member
Jul 19, 2017
24
2
3
Oregon
cPanel Access Level
Root Administrator
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?
 

VM Creativo

Member
Dec 8, 2018
8
7
3
Spain
cPanel Access Level
Root Administrator
From your root account:

Move to tmp dir

Code:
cd /tmp
Download WP-Cli

Code:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Make it executable:

Code:
chmod +x wp-cli.phar
Move it to /usr/local/bin

Code:
sudo mv wp-cli.phar /usr/local/bin/wp
If your users have a Jail Shell, they will be able to use the command
 
  • Like
Reactions: kamm and rudtek

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
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.
 

rudtek

Member
Jul 19, 2017
24
2
3
Oregon
cPanel Access Level
Root Administrator
@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.
 
  • Like
Reactions: cPanelLauren

rudtek

Member
Jul 19, 2017
24
2
3
Oregon
cPanel Access Level
Root Administrator
From your root account:

Move to tmp dir

Code:
cd /tmp
Download WP-Cli

Code:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
Make it executable:

Code:
chmod +x wp-cli.phar
Move it to /usr/local/bin

Code:
sudo 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?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,255
313
Houston
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!!