我刚刚安装了 Ubuntu,我的用户是超级用户,可以使用sudo
. 所以我认为这个用户被添加到/etc/sudoers
文件中。但它似乎不存在:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin 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:
#includedir /etc/sudoers.d
用户信息:
uid=1000(someuser) gid=1000(someuser) groups=1000(someuser),4(adm),24(cdrom),27(sudo),
30(dip),46(plugdev),113(lpadmin),128(sambashare)
我如何获得超级用户权限?
你在组里
sudo
。引用您的 sudoers 文件(我提请您注意有效行之前的有用注释):您的用户是
sudo
组的成员。正如您在
sudoers
文件中看到的那样,该组的所有成员都有权使用sudo
.