Execute a sudo shell script without password


Procedures


  • edit the sudoers
$ sudo vim /etc/sudoers
  • add command alias
# notice the CMD must be uppercase
Cmnd_Alias    CMD=/path/to/your/script
  • add the privilege
user    ALL=NOPASSWD: CMD

results matching ""

    No results matching ""