我尝试执行命令。
me@intern:~$ sudo ls
[sudo] password for me:
me is not in the sudoers file. This incident will be reported.
Run Code Online (Sandbox Code Playgroud)
但是我在sudo
群里
me@intern:~$ groups
sudo
Run Code Online (Sandbox Code Playgroud)
/ets/sudoers :
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
root ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
sudo ALL=(ALL:ALL) ALL
john ALL = NOPASSWD: /usr/sbin/service apache2 reload
john ALL = NOPASSWD: /usr/sbin/service apache2 restart
john ALL = NOPASSWD: /usr/bin/vi /etc/php/7.0/apache2/php.ini
Run Code Online (Sandbox Code Playgroud)
Kus*_*nda 11
您的sudoers
文件显示的是,被调用的用户sudo
可能会使用sudo
. 如果要添加名为的组sudo
,则按照与admin
组相同的方式进行,即%
在组名前添加一个:
%sudo ALL=(ALL:ALL) ALL
Run Code Online (Sandbox Code Playgroud)
(如果该admin
组未被系统上的任何人使用,我将同时删除其sudo
权限。)
组名以 为前缀%
,而用户名没有前缀。
此外,数字 UID 和 GID 可用于#
:
#1000 ALL= ...
%#1000 ALL= ...
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4361 次 |
最近记录: |