cqkpy

普通用户免输sudo

1. 进入root
su - root

2. 修改/etc/sudoers文件的权限
chmod u+w /etc/sudoers

3. 编辑内容
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
username ALL=(ALL) NOPASSWD:ALL # 添加此行,username为要加入sudoers的用户

4. 撤销/etc/sudoers文件的写权限
chmod u-w /etc/sudoers

posted on 2020-04-07 13:28  cqkpy  阅读(262)  评论(0编辑  收藏  举报