我无意中在根目录中使用了此命令,现在 ipa.ddr.ess:7080 不让我进入;它显示“凭据无效”。我使用的命令是
chown -R www-data:www-data /.
然后我实现这是一个错误,然后使用将大多数目录更改为 root:root
chown -R root:root /to-some-directories manually one by one
the directories in root
drwxr-xr-x 19 root root 4096 May 23 09:32 ./
drwxr-xr-x 19 root root 4096 May 23 09:32 ../
lrwxrwxrwx 1 root root 7 May 15 2020 bin -> usr/bin/
drwxr-xr-x 4 root root 4096 May 22 15:17 boot/
-rwxr-xr-x 1 root root 79639 Oct 1 2020 certbot-auto*
-rw------- 1 root root 1028653056 Jun 24 2020 cyberpanel.swap
drwxr-xr-x 16 root root 3780 Jun 15 14:04 dev/
drwxr-xr-x 117 root root 12288 Jun 15 14:38 etc/
drwxr-xr-x 8 root root 4096 Jun 4 17:00 home/
lrwxrwxrwx 1 root root 7 May 15 2020 lib -> usr/lib/
lrwxrwxrwx 1 root root 9 May 15 2020 lib32 -> usr/lib32/
lrwxrwxrwx 1 root root 9 May 15 2020 lib64 -> usr/lib64/
lrwxrwxrwx 1 root root 10 May 15 2020 libx32 -> usr/libx32/
drwx------ 2 root root 16384 May 15 2020 lost+found/
drwxr-xr-x 2 root root 4096 May 15 2020 media/
drwxr-xr-x 5 root root 4096 Jul 24 2020 mnt/
drwxr-xr-x 4 root root 4096 Jun 29 2020 opt/
dr-xr-xr-x 144 root root 0 Jun 9 04:50 proc/
drwx------ 11 root root 4096 Jun 23 10:00 root/
drwxr-xr-x 32 root root 1000 Jun 23 09:55 run/
lrwxrwxrwx 1 root root 8 May 15 2020 sbin -> usr/sbin/
drwxr-xr-x 7 root root 4096 Jun 17 07:19 snap/
drwxr-xr-x 3 root root 4096 Feb 4 09:40 srv/
dr-xr-xr-x 13 root root 0 Jun 9 04:50 sys/
drwxrwxrwt 23 root root 4481024 Jun 23 10:05 tmp/
drwxr-xr-x 15 root root 4096 May 22 15:16 usr/
drwxr-xr-x 13 root root 4096 May 15 2020 var/
-rw-r--r-- 1 root root 384 Jun 9 04:49 webadmin.csr
然后更改为 /home/example.com/public_html 到 www-data:www-data openlitespeed:7080 不让我使用 CORRECT-Credentials
答案1
您的命令是递归的,因此它会影响整个文件系统中的每个文件和文件夹。您可以费力地恢复所有文件的权限,但最好的选择是从备份中恢复。
答案2
我检查了/usr/local/lsws的权限,并进行了如下更改
chown -R nobody:nogroup autoupdate
chown -R nobody:nogroup cachedata
chown -R nobody:nogroup cgid
chown -R nobody:nogroup conf-backup
chown -R lsadm:nogroup conf
chown -R lsadm:nogroup conf-backup
chown -R lsadm:lsadm phpbuild
chown -R nobody:nogroup tmp
重新启动服务器,然后尝试更新
reboot
sudo apt update
它显示以下错误
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
更改权限如下
chmod 644 /usr/lib/sudo/sudoers.so
chown -R root /usr/lib/sudo
更新和升级工作正常 openlitespeed 面板也工作正常