I wanted to use WP-CLI commands in my putty WordPress 5.5.1 & Ubuntu 20.04 Droplet but “When I use Wp commands without –allow-root then It shows an error that you are accessing as the root user,” and I know it’s un-secure to use –allow-root. Please Can anyone help me in accessing wp commands in my Putty without –allow-root.
1 Answer
You can do is to create an additional user and switch to it in order to use the wp-cli
-
-
Please upvote my answer and mark it as solution :) so users can benifit Oct 18, 2020 at 13:01
root
the only user on your droplet? You could (and probably should) create a less-powerful user, give it write access to your website, and thensu {username}
and usewp
as that user instead.root
, you should be able to dosu {username}
where{username}
is the username you set up. If you're root, it shouldn't ask you for a password.