轻作



重拾写作的乐趣

sudoers免密码

2020.03.10

修改 /etc/sudoers

  1. Debian/Ubuntu
# User privilege specification
root    ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "@include" directives:
user    ALL=(ALL) NOPASSWD:ALL
  1. RedHat/CentOS/RockyLinux
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
user    ALL=(ALL)       NOPASSWD:ALL
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS

## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

## Same thing without a password
%wheel  ALL=(ALL)       NOPASSWD: ALL
发表评论