为什么我不能删除php文件?

时间:2014-07-21 07:24:52

标签: php linux

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

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

总共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

root @ host [/ home / depotdeb / public_html / hl] #rm 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

root @ host [/ home / depotdeb / public_html] #cd hl

root @ host [/ home / depotdeb / public_html / hl] #ls -il

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]#

1 个答案:

答案 0 :(得分:3)

根据这个:

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