Shell script - Sudo-permissions lost over time

后端 未结 6 1842
情歌与酒
情歌与酒 2020-12-09 00:22

I\'ve made a simple bash script that need to keep it\'s super-user privileges throughout the script. Unfortunately, but understandable the script looses its sudo

6条回答
  •  旧时难觅i
    2020-12-09 00:42

    You can adjust this timeout by adding to /etc/sudoers

    Defaults timestamp_timeout=#Number of minutes
    

    But it is much easier to run

    sudo ./worker.sh
    

提交回复
热议问题