Please support our Python advertiser: Programming Forums
Views: 2074 | Replies: 1
![]() |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Rep Power: 4
Solved Threads: 0
I need root privledges to do some stuff in my python script. I am currently using this technique
[php]
current_user = os.geteuid()
if current_user != 0:
print "you need to be root to run this script"
sys.exit()[/php]
this will at least polietly end the script so i am able to log in as root. then start the script as root user.
Is it a very involved process to have the script prompt me for my root password and switch users?
[php]
current_user = os.geteuid()
if current_user != 0:
print "you need to be root to run this script"
sys.exit()[/php]
this will at least polietly end the script so i am able to log in as root. then start the script as root user.
Is it a very involved process to have the script prompt me for my root password and switch users?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode