将普通用户添加到sudo组
1.打开终端,输入以下内容进入root环境。
su
2.输入以下内容编辑 /etc/sudoers 文件。
nano /etc/sudoers
3.找到以下内容:
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
4.在下面添加一行。
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
user ALL=(ALL:ALL) NOPASSWD:ALL
user 修改为你要添加的用户,NOPASSWD 表示不用重复输入root密码。
5.最后Ctrl+O保存,输入Ctrl-X退出即可。