在网上找了修改/etc/sudoers出现了错误
出现死循环,/etc/sudoers文件怎么也打不开,没有权限
测试各种方法
测试1:(没成功)
yr 不在 sudoers 文件中。此事将被报告。同时,su无法验证的解决办法
测试2:(成功),pkexec指令还可以修改,能修改就行,不去研究具体的了
cd /etc
pkexec visudo
修改后的sudors如下所示,修改完之后就可以用sudo了
#
# 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
d 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
再用大家通用的方法解决su
sudo passwd
根据提示输入su的新的密码,完成后会提示设置成功,整个问题完美解决