LinuxQuestions.org
Register a domain and help support LQ
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 03-16-2010, 05:47 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Rep: Reputation: 33
Owner of the file can not remove it


Probably a very basic and thumb question but I can't remove a file where I am owner of :
Code:
[jonas@webserver html]$ ls -l | grep file
-rw-rw-r-- 1 jonas jonas  3323 2010-03-15 20:33 file.php
[jonas@webserver html]$ rm file.php 
rm: cannot remove `file.php': Permission denied
The directory that holds this file is html :
Code:
[jonas@webserver mysite]$ ls -l
drwxr-xr-x 2 root  root    4096 2010-03-15 18:32 cgi-bin
drwxr-xr-x 9 apache webusers 4096 2010-03-15 20:34 html
 
Old 03-16-2010, 05:50 AM   #2
PJvG
LQ Newbie
 
Registered: Feb 2010
Location: Eindhoven, the Netherlands
Distribution: Ubuntu
Posts: 20

Rep: Reputation: 0
Would it help to give write permissions to the directory that holds the file?
Else couldn't you just remove it with sudo?

Good luck!
 
Old 03-16-2010, 05:52 AM   #3
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Try this:
Quote:
chattr -i file.php
$rm -rf file.php
You must be root to execute chattr.

Last edited by Sayan Acharjee; 03-16-2010 at 05:54 AM.
 
Old 03-16-2010, 05:57 AM   #4
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 632

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by PJvG View Post
Else couldn't you just remove it with sudo?
jonas is also my ftp-user and I am unable to change or delete files from within NetBeans.
I can't sudo here.

Giving write-permissions on 'html' to others clears the problem.

So I will have to make my user 'jonas' member of the group 'webusers'.
 
Old 03-16-2010, 08:07 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Basically, yes. Removing a file involves writing to the inode table ie the dir file itself.
 
  


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
Owner of a directory different than file owner problems Guardian-Mage Linux - Server 4 04-24-2009 11:26 AM
Display by File Name, File Size, and File Owner using ls akeenabawa Linux - Newbie 9 08-15-2008 03:21 PM
File owner and File group locked - root deiphage Linux - Hardware 5 02-05-2005 02:30 PM
Getting the owner name of a file in C akin81 Programming 5 04-02-2004 04:36 PM
file permissions and file owner won't change Nadim Slackware 5 11-29-2003 07:03 PM


All times are GMT -5. The time now is 04:47 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