privileges

What is the best way for checking if the user of a script has root-like privileges?

What is the best way for checking if the user of a script has root-like privileges? Question: I have a Python script that will be doing a lot of things that would require root-level privileges, such as moving files in /etc, installing with apt-get, and so on. I currently have: if os.geteuid() != 0: exit(“You …

Total answers: 10