I have a problem. I am writing a piece of software, which is required to perform an operation which requires the user to be in sudo mode. running 'sudo python filename.py' isn't an option, which leads me to my question. Is there a way of changing to sudo half way through a python script, security isn't an issue as the user will know the sudo password the program should run in the following way to illustrate the issue
- program running as normal user
- ...... performing operations
- user enters sudo password
- user changed to sudo
- sub program requiring sudo permission is run
- on trigger even (end of sub program) user becomes normal user again
- ...... performing operations
My problem lies in step 3, any pointers or frameworks you could suggest would be of great help.
Cheers
Chris