A
A
AlmazKayum2018-04-15 16:10:38
linux
AlmazKayum, 2018-04-15 16:10:38

How to edit files protected with sudo privileges using Python?

Good afternoon.
There is a file with configs /etc/3proxy/proxy.cfg
How can I edit this file using Python if sudo rights are needed there?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Z
zooks, 2018-04-15
@zooks

sudo ./script.py

D
devalone, 2018-04-15
@devalone

What does protected by sudo privileges mean? The file has an owner and access rights, respectively, you must either specify the correct file owner and access rights, or run the script as root (sudo), the second is not recommended in the general case.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question