I have a typical LAMP server setup (Ubuntu 16) with www-data:www-data setup for Apache.
I have a script that cannot be run as root but needs to run as www-data. The script recommends running sudo -u www-root -i -- <command>
but when I do this I get the error:
This account is currently not available.
How can I safely allow the www-data user to run the command, or how would I allow the current user to execute the command, if that's a better direction?
Note: the script in question is WP-CLI which forces an --allow-root flag, but advises against it because of security reasons.