
大家好,我有貓鼬,我一定弄亂了 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 檔案中授予 admin 群組成員 root 權限的行。