我对 Linux 还很陌生。最近,我使用命令“sudo chown -R me ./”来授予自己对某个文件夹的权限。如果重要的话,我在“/var/www”文件夹中运行了这个命令。此后,docker容器不断重启,无法启动。我收到错误:
Launching nginx...
Launching php-fpm...
Launching websocket server...
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
Launching frontend...
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
addgroup: group 'user' in use
adduser: user 'user' in use
Setting timezone to Europe/Warsaw
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: error in /etc/sudo.conf, line 0 while loading plugin "sudoers_policy"
sudo: /usr/lib/sudo/sudoers.so must be owned by uid 0
sudo: fatal error, unable to load plugins
我已经尝试更改这些文件的权限,因为错误表明这些文件应归 root 所有。问题是 sudo.cfg 已经归 root 所有:
当我尝试向“/usr/lib/sudo/sudoers.so”授予适当的权限时,它告诉我没有这样的路径:
chmod: cannot access '/usr/lib/sudo/sudoers.so': No such file or directory
我还能做什么?我需要重装系统吗?
答案1
你没有给我们足够的细节来做出有根据的猜测,但无论如何我都会尝试一下。
我认为上述错误消息发生在您的 docker 容器内,并且该容器位于(出于未知原因?)/var/www
...
我还将向您保证您确实在该目录中并且确实逐字发布了您所写的内容。
您现在需要检查的是 docker 镜像内这些文件的所有权,而不是您登录运行 nginx 的主机。