Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

I can't delete files on Cpanel or via Shell

Discussion in 'General Discussion' started by aristomania, Sep 17, 2013.

  1. aristomania

    aristomania Member

    Joined:
    Sep 17, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, I've tried deleting files via cpanel and they reapear, I also tried via shell with three different commands
    Code:
    chattr -iR or chattr -iaR and chattr -i
    But files are still reapearing...
    My permissions are 755..
    Thank you
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Could you elaborate on the files reappearing? Are they deleted and then created again, or does the initial deletion fail? What type of files are these?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. aristomania

    aristomania Member

    Joined:
    Sep 17, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,
    The folders get deleted on file manager but when I refresh page they reappear, on FTP it says cannot delete files.
    I want to delete everything uploaded on the server in order to upload a fresh backup and restore it, so all folders (administrator etc).

    Thank you.;)
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Please access your server via SSH and run the following commands on a file that you can not delete:

    Code:
    lsattr /home/username/path/to/file
    stat /home/username/path/to/file
    Let us know the output.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. aristomania

    aristomania Member

    Joined:
    Sep 17, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I ran those two codes separatedly and got this

    " Size: 4096 Blocks: 8 IO Block: 4096 directory
    Device: adh/173d Inode: 60495175 Links: 10
    Access: (0755/drwxr-xr-x) Uid: ( 99/ nobody) Gid: ( 99/ nobody)
    Access: 2013-09-17 15:32:22.000000000 +0400
    Modify: 2013-09-16 16:00:42.000000000 +0400
    Change: 2013-09-17 13:28:35.000000000 +0400
    "

    The file is still there, thank you

    - - - Updated - - -

    It seems I can create or delete folders on home/user/ but I cannot create or delete files on /home/usr/public_html or /www
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    As you can see, the file is owned by the "nobody" username. The best way to delete these files is via SSH as "root".

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. aristomania

    aristomania Member

    Joined:
    Sep 17, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Well I always log as the username "root", besides I don't know how to login on SSH without the "root" username..
    I solved this issue by terminating the account and creating a new account on WHM.
    Thanks
     
  8. Stallyon

    Stallyon Member

    Joined:
    Sep 14, 2005
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    151
    cPanel Access Level:
    Root Administrator
    If you're root, next time try

    chown root:root file.name
    rm -f file.name
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,423
    Likes Received:
    1,957
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    To clarify, you were unable to remove those files via SSH, even when logged in as "root"? If that was the case, you may have wanted to run the "lsattr" command provided earlier to see if they were writable.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice