Setuid bit on python script : Linux vs Solaris

后端 未结 3 1613
余生分开走
余生分开走 2020-12-03 14:44

I am running this small python script on both linux and Solaris as a not privileged user :

#!/usr/bin/python
import os
print \'uid,euid =\',         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 14:59

    You could potentially use sudo to achieve what you want. It runs stuff as different users:

     sudo -u otheruser command
    

    Permissions are set by root using visudo. The setuid/setguid stuff doesn't appear to apply to scripts or the shell in linux, only compiled code.

提交回复
热议问题