The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  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:
    1
    cPanel Access Level:
    Root Administrator
    If you're root, next time try

    chown root:root file.name
    rm -f file.name
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page