I can't delete files on Cpanel or via Shell

aristomania

Member
Sep 17, 2013
7
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

aristomania

Member
Sep 17, 2013
7
0
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.;)
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

aristomania

Member
Sep 17, 2013
7
0
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
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.
 

aristomania

Member
Sep 17, 2013
7
0
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
 

Stallyon

Member
Sep 14, 2005
12
0
151
cPanel Access Level
Root Administrator
If you're root, next time try

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

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Well I always log as the username "root", besides I don't know how to login on SSH without the "root" username..
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.