| | |
changing to root user
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: May 2005
Posts: 215
Reputation:
Solved Threads: 16
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?
![]() |
Similar Threads
- 0 file in root? (Darwin, X11 and BSD)
- Using 'nix-like User Permissions in Windows XP (Windows NT / 2000 / XP)
- Changing permission for www/html directory (Window and Desktop Managers)
- changing osx ownership and permissions (Mac Software)
- Linux Unable to log in with newly create user (IT Professionals' Lounge)
Other Threads in the Python Forum
- Previous Thread: Tutorials
- Next Thread: copy a file
Views: 2661 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Python
advanced anydbm app assignment bash beginner bits bluetooth calling chmod cmd code convert data decimals dictionary dynamic dynamically examples excel external file float format ftp function gnu gui homework http import input itunes jaunty java keycontrol leftmouse line linux list lists loan loop maintain millimeter module mouse newb number numbers output parsing path pointer port prime program programming projects push py-mailer py2exe pygame pyglet pyqt python random recursion recursive scrolledtext slicenotation smtp split ssh string strings table tennis terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode update urllib urllib2 variable variables ventrilo web webservice windows wxpython xlib






