New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Cant Delete folder with permission 000 ( or modify them )
hi, i have a folder in a server that i dont know how or why it changes to "000".
i cant delete it as user or even with root.
i try many things but still cant delete it,
[root@yeah admin]# sudo chown -R root:root services_management
chown: changing ownership of `services_management': Operation not permitted
[root@yeah admin]# touch services_management
touch: setting times of `services_management': Permission denied
[root@yeah admin]# sudo touch services_management
touch: setting times of `services_management': Permission denied
[root@yeah admin]# ll
drwxr-xr-x. 4 easy111 easy111 4096 Jan 27 2013 css
-rw-r--r--. 1 easy111 easy111 8724 Jan 27 2013 index.php
d---------. 3 easy111 easy111 4096 Jan 27 2013 services_management
what can i do?
thank you.
Comments
Have you tried using chmod to change the permissions of the folder so your account will have read and write access?
yes, many times.
chmod and chown.
when i use chmod, the permission just don't stick there.
it goes back to 000
From some quick Googling, I found a thread on the Ubuntu forums that appears to be similar to your issue, including several different attempted solutions that worked for various people. Perhaps you'll be able to replicate one of their suggestions and get a successful result:
https://ubuntuforums.org/showthread.php?t=1322037
Hi, give it a try with chattr -i then rm -rf folder
Also run auditd to figure out what's changing the file.
Cant you put it as a one-liner so there's no pause between the chown/chmod and the rm?
this worked
thanks @racksx
i didnt have chance to try the other two options, thanks @Corey @teamacc @Pwner
In the event that anyone else ever finds this, a couple of additional points: lsattr will show you the extended attributes, and only root can set/remove immutability on files:
damian@mainframe:~$ touch testfile damian@mainframe:~$ lsattr testfile --------------e---- testfile damian@mainframe:~$ chattr +i testfile chattr: Operation not permitted while setting flags on testfile damian@mainframe:~$ sudo chattr +i testfile [sudo] password for damian: damian@mainframe:~$ lsattr testfile ----i---------e---- testfile damian@mainframe:~$ unlink testfile unlink: cannot unlink 'testfile': Operation not permitted damian@mainframe:~$ sudo chattr -i testfile damian@mainframe:~$ unlink testfile damian@mainframe:~$