I have a python script running on a home laptop that runs Ubuntu 13.10. I want to give 2 or 3 people the ability to start or kill that script, but no other privileges. I don't want to give them access to the script itself, since the code is sensitive. Is there an easy way to do that?
There are a thousand and one ways to do this.
One way you might consider is from a BasicAuth protected Apache server with PHP. PHP could exec the python script for you and also shell execute a kill on the same script.
PHP exec() - http://php.net/manual/en/function.exec.php
This is not the most robust, secure or best way to accomplish what you're wanting, but it technically fits the requirements and is simple to set up. It is pretty much guaranteed to make any administrator's hair stand on end.
If you want to use your python script longterm on a less than casual project you might consider porting it to be used with mod_python, recreate it for use in a web service, etc.
sudo command that permits user to become root or run some files that need root privileges. You should define your users at
/etc/sudoers file. Of course you need to block some command, please read
man sudoers , to can customize it.
The easiest way would probably be to set up a simple webserver with a single webpage and a link to start/stop the script.
Or if your users are at ease with SSH clients, you could try to set an SSH jail (see e.g. this question).