I've created a startup script in bash that calls a Python script. However when I run "sudo sh StartUpScript.sh" from the command prompt it says:

"Sorry, user root is not allowed to execute '/usr/bin/python3 /home/pi/python Indoor-Air-Quality-MQTT.py' as root on user1.

I'm logged on as a user called remoteuser and I've given remoteuser full privilege in sudoers.

remoteuser ALL=(ALL:ALL) AL

Any ideas how ti can get this script to run?

  • To be honest this is more of a U&L SE question... – SlySven Dec 22 '17 at 4:36

The path shown does not look correct:

/home/pi/python Indoor-Air-Quality-MQTT.py

Looks like it should be:


(notice the / between python and Indoor)

From the now-deleted answer:

ls -l "/home/pi/python Indoor-Air-Quality-MQTT.py"

  1. Verify the permissions of the python script.
  2. Verify the python script is executable.

ls -ld "home/pi/python"

  1. Verify the permissions of the directory containing the script.

The post also suggested adding an entry to /etc/sudoers to remove the need to run as root.

Not the answer you're looking for? Browse other questions tagged or ask your own question.