Create linux-sudo-bypass-password.md

no more annoying passwords
This commit is contained in:
Brandon Scott 2021-02-23 07:36:06 -06:00 committed by GitHub
parent 5ab3090c86
commit df3a08e162
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,8 @@
You can configure sudo not to require a password for specific commands, by adding a sudoers rule with the NOPASSWD: tag. Note that NOPASSWD rules must come after non-NOPASSWD rules that match the same command.
```
%admin: ALL = (ALL:ALL) ALL
%admin: ALL = (root) NOPASSWD: apt-get
```
Note that allowing apt-get is as dangerous as allowing any command, since the caller could pass options that cause apt-get to download packages from sources that they specify, that cause it to invoke hooks that they specify, etc.