Python判断当前用户是否是root

import os
if os.geteuid() != 0:
print "This program must be run as root. Aborting."
sys.exit(1)

posted @ 2015-02-04 14:04  Dus  阅读(1603)  评论(0编辑  收藏  举报