Differences between revisions 4 and 5
Revision 4 as of 2024-09-30 17:01:35
Size: 425
Editor: 216
Comment:
Revision 5 as of 2024-09-30 17:01:55
Size: 425
Editor: 216
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
step 4: {{{ # sudo u+s [scriptname] }}} Step 4: {{{ # sudo u+s [scriptname] }}}

Scripting Python setuid

This is primarily about writing a script that needs to be run as root by non-root users.

Step 1: Write your script and make sure that your script does exactly and only what you want it to be.

Step 2:  # pyinstaller -F [scriptname] 

Step 3:  # sudo chown root:root [scriptname] 

Step 4:  # sudo chmod 770 [scriptname] 

Step 4:  # sudo u+s [scriptname] 

ScriptingPythonSetuid (last edited 2024-09-30 17:01:55 by 216)