大家好,我有 meerkat,我肯定把 sudoers 搞乱了。这是我现在的情况。
ubuntu:/etc$ ifconfig Command 'ifconfig' is available in
'/sbin/ifconfig' The command could not be located because '/sbin' is
not included in the PATH environment variable. This is most likely
caused by the lack of administrative privileges associated with your
user account. ifconfig: command not found @ubuntu:/etc$ ^C
@ubuntu:/etc$ htop @ubuntu:/etc$ ls -l /etc/environment
-rw-r--r-- 1 root root 79 Feb 15 09:54 /etc/environment @ubuntu:/etc$ cd /etc/environment
-bash: cd: /etc/environment: Not a directory @ubuntu:/etc$ sudo nano /etc/environment
>>> /etc/sudoers: syntax error near line 17 <<< sudo: parse error in /etc/sudoers near line 17 sudo: no valid sudoers sources found,
quitting
你会推荐什么?
答案1
在这种情况下,格式对我来说似乎是一个积极的解决方案。
我会尝试修复 sudoers 文件(我猜您手动编辑了它?您可能想授予用户“管理员权限”?),然后将 /sbin 添加到 PATH 中。
您可能还想将您的用户添加到 adim 组,并取消注释 sudoers 文件中授予管理员组成员 root 权限的行。