Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么我能';你不能删除php文件吗?_Php_Linux - Fatal编程技术网

为什么我能';你不能删除php文件吗?

为什么我能';你不能删除php文件吗?,php,linux,Php,Linux,我的服务器中有一个php文件。我试图删除它,但被拒绝。它是由php病毒创建的 root@host[/home/depotdeb/public#html][ls-la hl chown: changing ownership of `hl': Operation not permitted total 12 26620397 d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./ 533919 drwxr-x--- 6 depotdeb dep

我的服务器中有一个php文件。我试图删除它,但被拒绝。它是由php病毒创建的

root@host[/home/depotdeb/public#html][ls-la hl

chown: changing ownership of `hl': Operation not permitted
total 12
26620397 d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
  533919 drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
26620398 -rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
总数12

d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./ 
drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
-rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host [/home/depotdeb/public_html]# cd hl
root@host [/home/depotdeb/public_html/hl]# rm -f index.php
rm: cannot remove `index.php': Permission denied
root@host[/home/depotdeb/public_html/hl]#lsattr index.php

-------------e- index.php
root@host [/home/depotdeb/public_html/hl]# ls -la
total 12
d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
-rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host [/home/depotdeb/public_html/hl]# chattr -i index.php
root@host [/home/depotdeb/public_html/hl]# lsattr index.php
-------------e- index.php
rm: remove regular file `index.php'? y
rm: cannot remove `index.php': Permission denied
root@host [/home/depotdeb/public_html/hl]# cd ../
root@host[/home/depotdeb/public_html/hl]#rm index.php

-------------e- index.php
root@host [/home/depotdeb/public_html/hl]# ls -la
total 12
d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
-rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host [/home/depotdeb/public_html/hl]# chattr -i index.php
root@host [/home/depotdeb/public_html/hl]# lsattr index.php
-------------e- index.php
rm: remove regular file `index.php'? y
rm: cannot remove `index.php': Permission denied
root@host [/home/depotdeb/public_html/hl]# cd ../
root@host[/home/depotdeb/public_html]#chown depotdeb.depotdeb hl

chown: changing ownership of `hl': Operation not permitted
total 12
26620397 d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
  533919 drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
26620398 -rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host[/home/depotdeb/public#html]#cd hl

chown: changing ownership of `hl': Operation not permitted
total 12
26620397 d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
  533919 drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
26620398 -rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host[/home/depotdeb/public_html/hl]#ls-il

chown: changing ownership of `hl': Operation not permitted
total 12
26620397 d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
  533919 drwxr-x--- 6 depotdeb depotdeb 4096 Jul 21 01:49 ../
26620398 -rwxrwxrwx 1 depotdeb depotdeb   89 Jul 21 01:48 index.php*
root@host[home/depotdeb/public#html/hl]

根据以下内容:

d--------- 2 depotdeb depotdeb 4096 Jul 16 11:25 ./
您没有对文件所在的文件夹
hl
的写入权限。试试这个:

cd /home/depotdeb/public_html
chmod 755 ./hl
#unset the immutable bit for the folder:
chattr -i ./hl
rm /home/depotdeb/public_html/hl/index.php

该文件是否具有覆盖基本权限的ACL?您是否具有对
hl
文件夹的
write
权限?@Cattla也许,这将有助于: