LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 04:47 AM   #1
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Rep: Reputation: 34
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, 04: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, 04:52 AM   #3
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

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 04:54 AM.
 
Old 03-16-2010, 04:57 AM   #4
jonaskellens
Member
 
Registered: Jul 2008
Location: Ghent, Belgium
Distribution: Fedora, CentOS
Posts: 690

Original Poster
Rep: Reputation: 34
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, 07:07 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:11 PM.

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
Open Source Consulting | Domain Registration