Originally posted on 2021-02-10
This error message is truly odd in my humble opinion. I was working on a project today with someone and they saw this error message in their log file. Basically it appeared that root was not allowed to switch users and run a Python script as a different user.
Shouldn't root be able to change into any user? You'd think, but apparently not.
How do you fix it? Stack Overflow bails us out again. The gist is that you need to update /etc/sudoers (with visudo!) and add this line if it is missing:
root ALL=(ALL:ALL) ALLFor reference, a default Ubuntu /etc/sudoers that has this in it looks like this: