我意外地更改了/ etc的权限而无法解决它
Sudo Error
-bash-4.2$ sudo su
sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin
/etc permissions
lrwxrwxrwx. 1 0 0 7 Oct 28 12:59 bin -> usr/bin
drw-rw-rw-. 94 0 0 4096 Mar 1 09:47 etc
files under the /etc folder shows like below
d????????? ? ? ? ? ? yum.repos.d
-????????? ? ? ? ? ? yum.conf
d????????? ? ? ? ? ? yum
d????????? ? ? ? ? ? xinetd.d
d????????? ? ? ? ? ? xdg
-????????? ? ? ? ? ? wgetrc
请帮我了解如何恢复权限和所有权
我尝试使用以下命令解决它但无法解决它
apt-get -o Dpkg::Options::="--force-confmiss" install --reinstall sudo
找不到apt-get命令
pkexec chmod 755 /etc
未找到pkexec命令
还尝试使用rpm
更改权限rpm --setperms /
答案 0 :(得分:0)
我建议使用恢复模式重启系统。在/etc
上生成root shelle会话和恢复权限。但是,您报告的错误不仅与/etc
权限相关,因此我认为还有其他问题。
答案 1 :(得分:0)
这是解决方案。
1。尝试以下命令:
<button class="ABCD_Buttons" [style.background]="buttonColor">D</button>
2。如果不是那样的话:
-r--r ----- 1根轮1563 2016年12月11日/ etc / sudoers
然后只需使用以下命令即可更改该文件的权限:
ls -ld /etc/sudoers
3。重新启动您的终端,一切正常!