Failed to reload nginx.service: Interactive authentication required Failed to reload nginx.service: Interactive authentication required nginx nginx

Failed to reload nginx.service: Interactive authentication required


Most probably nginx doesn't run with user root which is what you need to use systemctl. Therefore you should execute your command using sudo.

Now there are different ways of running a command from web-server with root privileges:

  • Run nginx with user root which is highly discouraged for obvious security reasons
  • Add only this specific command to sudoers as described here in order to run it with root privileges without any password prompt
  • Pass your root password through echo as described here
  • Write a bash script with limited functions as described here

But of course you might find something else searching on for it.