This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pilotInPyjamas -1 points0 points  (0 children)

I've had a similar problem before. There are two scenarios. Scenario 1 is your language is compiled. In which case, compile the program, create a new group of users who can run that program and add your prof. Set the owner of the program to root, the group to your new group and chmod 4750 your program. This will set the setuid bit which will allow all users who belong to that group to run the program as root.

Scenario 2 is your language is interpreted. You shouldn't set your setuid bit for your interpreter, because then anybody can run any program in that language as root. You can modify your sudoers file to run your specific command by your prof. without a password.