I had a script (named script) in bash, and I wanted to allow an user (named "userScript") to run it as root without giving any password.
So, I edited the file /etc/sudoers and added 2 lines at the end :
Cmnd_Alias SCRIPT=/home/userScript/Desktop/script
userScript ALL:NOPASSWD: SCRIPT
(The script in the desktop is a symbolic link to prevent any modification)
It worked perfectly well. After some days, my script was too big, so I rewrote it in python, with multiples files, classes...
So, I changed nothing except the symbolic link's target, but now when I try to run the script, the terminal ask for a password, and give me an error (sorry if it's not exactly the good message, my Ubuntu isn't in English)
Sorry, user userScript isn't allowed to execute "/usr/bin/python script" as root on name_of_my_computer
I run the script like this as user "userScript" :
sudo python script
sudo /home/script/Desktop/script.sh
?