Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Cant Delete folder with permission 000 ( or modify them )
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.

Cant Delete folder with permission 000 ( or modify them )

dedicadosdedicados Member
edited June 2017 in Help

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

  • PwnerPwner Member

    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

  • PwnerPwner Member

    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

    Thanked by 1dedicados
  • racksxracksx Member

    Hi, give it a try with chattr -i then rm -rf folder

    Thanked by 1dedicados
  • CoreyCorey Member

    Also run auditd to figure out what's changing the file.

    Thanked by 1dedicados
  • Cant you put it as a one-liner so there's no pause between the chown/chmod and the rm?

    Thanked by 1dedicados
  • dedicadosdedicados Member
    edited June 2017

    @racksx said:
    Hi, give it a try with chattr -i then rm -rf folder

    this worked

    [root@stitch admin]# chattr -i services_management
    [root@stitch admin]# rm -rf services_management
    [root@stitch admin]# ll
    total 0
    

    thanks @racksx

    i didnt have chance to try the other two options, thanks @Corey @teamacc @Pwner

    Thanked by 2Pwner racksx
  • DamianDamian Member

    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:~$

    Thanked by 2Pwner dedicados
Sign In or Register to comment.