LinuxQuestions.org
Review your favorite Linux distribution.
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 08-20-2011, 11:04 PM   #1
7kaltoid
LQ Newbie
 
Registered: Mar 2007
Distribution: OpenSUSE
Posts: 5

Rep: Reputation: 0
Question Permission denied to root trying to remove directory


Trying to rmdir in Opensuse 11.1 as root. Error returned is "Permission denied". Perms are drwxrwxsr-x.

I have tried command line and Konqueror with equally dismal results.

Also, tried to search for an answer without luck. I am a casual linux user only.

Help!

Last edited by 7kaltoid; 08-20-2011 at 11:08 PM.
 
Old 08-20-2011, 11:30 PM   #2
siranjeevi
Member
 
Registered: May 2010
Location: India
Posts: 79

Rep: Reputation: 7
Hi,

Seems like the folder has attributes set in it. Can you try the following command.?.. and paste the output here.

lsattr <filename>
 
Old 08-21-2011, 12:28 AM   #3
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by siranjeevi View Post
Hi,

Seems like the folder has attributes set in it. Can you try the following command.?.. and paste the output here.

lsattr <filename>
lsattr is only useful for ext2 file systems. Most people are using some other fs such as ext3/ext4. The command yields uninteresting results on those systems:
Code:
~$ lsattr hardware.txt
--------------- hardware.txt
@7k You need to remove the directory as root or using sudo.
ciao,
jdk
 
Old 08-21-2011, 03:19 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,
@jdkaye:
Quote:
Originally Posted by jdkaye
lsattr is only useful for ext2 file systems. Most people are using some other fs such as ext3/ext4. The command yields uninteresting results on those systems:
lsattr and chattr work perfectly on a ext3 (and probably ext4/ReiserFS):
Code:
$ grep tmp /etc/fstab 
/dev/sdb3      /tmp                    ext3      defaults         0     2

$ cd /tmp/
$ touch foobar
$ lsattr foobar 
------------- foobar
$ chattr +i foobar 
$ lsattr foobar 
----i-------- foobar
$ rm -f foobar 
rm: cannot remove `foobar': Operation not permitted
$ chattr -i foobar 
$ lsattr foobar 
------------- foobar
$ rm foobar
I do agree that the OP's problem is probably not related (different error message), but it is worth checking. I am assuming an ext2/3/4 FS is being used. It has been a while since I used SuSe, it did use reiserFS and I do remember reading somewhere that there is a lsattr/chattr that supports this FS.

Hope this helps.
 
Old 08-21-2011, 03:41 AM   #5
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,464

Rep: Reputation: Disabled
Quote:
Originally Posted by druuna View Post
Hi,
@jdkaye:


lsattr and chattr work perfectly on a ext3 (and probably ext4/ReiserFS):

I do agree that the OP's problem is probably not related (different error message), but it is worth checking. I am assuming an ext2/3/4 FS is being used. It has been a while since I used SuSe, it did use reiserFS and I do remember reading somewhere that there is a lsattr/chattr that supports this FS.

Hope this helps.
I was basing myself on the info lsattr entry:
Quote:
LSATTR(1) LSATTR(1)

NAME
lsattr - list file attributes on a Linux second extended file system
I interpreted "Linux second extended file system" to mean ext2. Was I wrong?
thanks,
jdk
 
Old 08-21-2011, 03:47 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389Reputation: 2389
Hi,
Quote:
Originally Posted by jdkaye View Post
I interpreted "Linux second extended file system" to mean ext2. Was I wrong?
Yes

The man page does explicitly mention ext2, but it does work on ext3 (as I showed in my previous post). I don't have access to ext4/ReiserFS at the moment, but I'm almost certain it works on ext4. Don't know about ReiserFS though, I do believe you need a patched lsattr/chattr version.

Hope this helps.
 
Old 08-21-2011, 04:06 AM   #7
sahabcse
LQ Newbie
 
Registered: Mar 2009
Location: colachel
Posts: 7

Rep: Reputation: 0
Who is the owner of the file. Pls paste the following o/p
ls -al filename

Last edited by sahabcse; 08-21-2011 at 04:08 AM.
 
Old 08-21-2011, 01:04 PM   #8
7kaltoid
LQ Newbie
 
Registered: Mar 2007
Distribution: OpenSUSE
Posts: 5

Original Poster
Rep: Reputation: 0
DIR owner is root:root

Someone suggested removing the parent directory. As I look back on it, that's not something I tried. Stay tuned and thanks for all the info so far.
 
Old 08-21-2011, 01:14 PM   #9
7kaltoid
LQ Newbie
 
Registered: Mar 2007
Distribution: OpenSUSE
Posts: 5

Original Poster
Rep: Reputation: 0
That fixed it.

Thanks again.
 
Old 08-21-2011, 08:05 PM   #10
jv2112
Member
 
Registered: Jan 2009
Location: New England
Distribution: Arch Linux
Posts: 719

Rep: Reputation: 103Reputation: 103
The directory has the SGID ( Octal 2775 ) set. So the directory contents permissions are determined by the group. In this case root. So the only two sets of people who can write to the files or directory are the group or owner. You would need to modify as root ( su / sudo ) .


Hope this helps.
 
Old 08-22-2011, 01:51 AM   #11
rob.rice
Member
 
Registered: Apr 2004
Distribution: slack what ever
Posts: 998

Rep: Reputation: 167Reputation: 167
rmdir - remove empty directories
is it empty ?
 
  


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
Cannot write to /misc directory - permission denied as root etuhs Fedora 4 06-01-2007 07:20 AM
Root denied permission to remove files suse_buse Linux - General 3 10-26-2006 06:56 PM
Root denied permission to remove users' files suse_buse Linux - Security 2 10-25-2006 08:26 AM
Permission denied existing directory root/user BDHamp Linux - General 5 04-10-2006 09:41 AM
root gets 'Permission denied' to directory mikemrh9 Linux - Security 2 11-18-2005 04:15 AM


All times are GMT -5. The time now is 03:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration