Using WP CLI on CloudLinux/cPanel server without shell
-
This may not be the right forum, but I didn’t see anyplace else that seems appropriate for system administrative questions pertaining to WP CLI.
I have several shared hosting servers that are built on CloudLinux and WHM/cPanel and the user accounts do not have shell access. I also have a script that allows me to quickly install WordPress on a user account, but it is pretty raw and could be vastly improved with WP CLI. I login via SSH with EC key pairs, and there is an external gateway/firewall in front of the servers that allows port 22 only from specific administrative IP addresses. So my administrative user is the root user. I currently run my script as root.
The wp command throws up a strong warning about running as root. It suggest I use the command
sudo -u USER -i -- wp <command>instead. To do so I would have to enable jailed user shells for all users. Due to a feature in CloudLinux called Link traversal protection and the way it manages chroot filesystems between users, doing so forces you to choose between two bad options, both of which I would like to avoid.Running instead as
sudo -u USER wp <command>allows it to run without the interactive user shell and it will then work without having to enable jailed user shells for all users. The users exist, but by dropping the-iswitch and the double hyphen I am not requiring an interactive login shell.So what are the consequences of using the wp command without the interactive login shell. Will using
sudo -u USER wp <command>instead ofsudo -u USER -i -- wp <command>break anything?Thank you.
The topic ‘Using WP CLI on CloudLinux/cPanel server without shell’ is closed to new replies.