This article will describe how to omit sudo password. This will enable scripts with sudo be automated.
Table of Contents
1 Omit sudo password
The /etc/sudoers is as the following by default.
## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL
You need to use NOPASSWD for omitting password. Run "sudo visudo" or "sed". This needs sudo password yet.
$ sudo sed -e 's/^%wheel/#%wheel/g' -e 's/^# %wheel/%wheel/g' \ -i /etc/sudoers
After reboot, you can run sudo without password.