Run a linux system command as a superuser, using a python script

后端 未结 6 1849
野性不改
野性不改 2020-12-13 10:32

I have got postfix installed on my machine and I am updating virtual_alias on the fly programmatically(using python)(on some action). Once I update the entry in the /etc/pos

6条回答
  •  生来不讨喜
    2020-12-13 11:23

    To answer the error:"sudo: sorry, you must have a tty to run sudo", we have a setting called "Defaults requiretty" in sudoers file. I tried commenting it out and it worked :D.

提交回复
热议问题