/etc/sudoers 问题

/etc/sudoers 问题

我在 i3 笔记本电脑上运行 ubuntu 12.04。我错误地更改了权限并更改了 /etc 文件夹的用户(从 root 用户),并且在尝试使用以下操作时出现错误sudo

sudo: /etc/sudoers is made 0777, should be 0440
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

我尝试进入恢复模式和 root shell 提示符然后我做了以下操作

chown root:root /etc/sudoers 
chmod 440 /etc/sudoers
chown -R root:root /etc/sudoers.d
chmod 755 /etc/sudoers.d 
chmod 440 /etc/sudoers.d/*

但每条命令之后都会显示:

Read only file systems and it does nothing. Thanks in advance for your help.

答案1

重新挂载文件系统为读/写

mount -o remount,rw /

并再次运行那些 chown/chmod。

相关内容