How do I edit /etc/sudoers from a script?

后端 未结 12 790
花落未央
花落未央 2020-12-04 05:43

I need to edit /etc/sudoers from a script to add/remove stuff from white lists.

Assuming I have a command that would work on a normal file, how could I

12条回答
  •  [愿得一人]
    2020-12-04 06:45

    visudo is supposed to be the human interface for editing /etc/sudoers. You can achieve the same by replacing the file directly, but you have to take care yourself about concurrent editing and syntax validation. Mind the r--r----- permissions.

提交回复
热议问题