Sudo Without Password
How can I setup sudo so I can run it without entering my password every time I use it? NOTE: I know that there is a timeout that lets you run it for a bit without requiring it again, but if I want to disable it entirely how do I do that?
sudo visudo
# Then make this change
# %sudo ALL=(ALL:ALL) ALL
%sudo ALL=(ALL:ALL) NOPASSWD: ALL
After that add yourself to the sudo’ers group.
sudo vi /etc/group
sudo:x:27:user1,user2
Add your username to the list, and comma separate if multiple users need to be added.
Run
sudo -l
To see the sudo configuration you’re user has. For example, I see
sudo -l
Matching Defaults entries for user1 on host2:
env_reset, mail_badpass, secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin,
use_pty
User user1 may run the following commands on host2:
(ALL : ALL) NOPASSWD: ALL