群晖root无法进入又不能sudo的解决方法

4 min read

如果你也是看了傻逼教程把将sudoers文件中的%administrators ALL=(ALL) ALL修改为%administrators ALL=NOPASSWD: ALL,那么请看下面的解救过程

进入到 计划任务,将/etc 的权限全开777

修改 /etc/sudoers 文件,群晖的原文件如下,恢复,再改回原权限就行

## sudoers file.

# Enable logging of a command's output.
# Use sudoreplay to play back logged sessions.
Defaults syslog=authpriv

# Allow root to execute any command
root ALL=(ALL) ALL

# Allow members of group administrators to execute any command
%administrators ALL=(ALL) ALL

# Configure privilege of wheel group
Cmnd_Alias SHELL = /bin/ash, /bin/sh, /bin/bash
Cmnd_Alias SU = /usr/bin/su
%wheel ALL=(ALL) NOPASSWD: ALL, !SHELL, !SU

# Include user-defined sudoers
#includedir /etc/sudoers.d