LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-16-2013, 04:22 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,002

Rep: Reputation: 67
why can I not delete a file I own??


I logged into my server as user wordpressdev via ssh. I want to delete a file that belongs to wordpressdev but cannot:
Code:
[wordpressdev@host html]$ ls -al error_log
-rw-rw-r-- 1 wordpressdev apache 81746 Jan 15 19:57 error_log
[wordpressdev@host html]$ whoami
wordpressdev
[wordpressdev@host html]$ rm error_log
rm: cannot remove `error_log': Permission denied
WHAT THE HECK? It's pretty urgent that I sort this out. I need to delete all these files ASAP. Any help would be truly appreciated.

this also baffles:
Code:
[wordpressdev@host html]$ getfacl error_log
# file: error_log
# owner: wordpressdev
# group: apache
user::rw-
group::rw-
other::r--
 
Old 01-16-2013, 04:49 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Probably ownership of the "html" directory the file resides in?
 
Old 01-16-2013, 04:51 PM   #3
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 981
Blog Entries: 2

Rep: Reputation: 235Reputation: 235Reputation: 235
Look at the access to the current directory rather than the file.
Code:
ls -ld
 
Old 01-16-2013, 05:17 PM   #4
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,002

Original Poster
Rep: Reputation: 67
You guys are both correct. Sorry for posting such a basic thing. The ownership of the directory was ok (root:wordpressdev) the problem was that it was 755 rather than 775. Sorry to trouble!
 
Old 01-18-2013, 07:42 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
The file permissions control access to the contents of the file.
The directory permissions control access to the contents of the directory.

A "directory" is really just a special kind of file; one that contains a list of the other files "in" it. If you have permission to alter this list, then you can add, delete, or rename a file, even if you don't have permission to access its contents (and vice-versa).

http://content.hccfl.edu/pollock/AUn...ermissions.htm
 
Old 01-18-2013, 10:47 AM   #6
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,002

Original Poster
Rep: Reputation: 67
Quote:
Originally Posted by David the H. View Post
The file permissions control access to the contents of the file.
The directory permissions control access to the contents of the directory.

A "directory" is really just a special kind of file; one that contains a list of the other files "in" it. If you have permission to alter this list, then you can add, delete, or rename a file, even if you don't have permission to access its contents (and vice-versa).

http://content.hccfl.edu/pollock/AUn...ermissions.htm
Thanks, David. I was actually aware of that. I just wasn't looking closely enough at the ls -l results to see all the little w's, r's, and x's.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell script to get name of file, delete original file, rename blank file chrisgti Linux - General 11 09-15-2012 03:49 AM
Create the file, write into that file but can't delete file in Linux pandunr Linux - Newbie 3 06-15-2011 09:45 AM
file from install ffmpeg conflicts w/file from package fmpeg-libs: which to delete? ybalazs Linux - Software 0 10-27-2009 02:21 AM
Upload file to ftp server -vsftp- but can not delete or change the file once uploaded murattas6 Linux - Server 2 06-26-2009 07:00 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 03:46 AM


All times are GMT -5. The time now is 12:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration