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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-13-2006, 12:47 PM
|
#1
|
Member
Registered: Mar 2003
Posts: 178
Rep:
|
How exactly does Linux file permission inheritance work
I'm familar with file permissions under Linux. However, one thing I'm not sure of is how come I'm able to delete a file when I shouldn't have the right to. I have it set that the parent folder has rights to read/write/execute but the file only has read/execute permission. So why am I able to delete the file? I'm using Debian Sarge and here's the parent folder's permission:
drwxrwxr-x 2 root users 48 2006-04-13 11:35 test
The file's permissions are as so:
-rw-r--r-- 1 root root 0 2006-04-13 12:45 testfile
Now as geneanthony which belongs to the user's group I can delete testfile. However, the permissions on the file says I can't, how come I can? What's the purpose of a file ACL if the parent folder always overrides it?
|
|
|
04-13-2006, 01:22 PM
|
#2
|
Member
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275
Rep:
|
Because if a folder/directory has write permission then it overrules the file permissions. Usually you would give the directory read and execute permissions enabling someone to enter the directory, then they can only do what they have permission to do to the file.
I'd suggest you read up a bit more on permissions and create a couple of accounts to play around with to test things out.
Also investigate the 'sticky bit' permissions.
Last edited by Dudydoo; 04-13-2006 at 02:01 PM.
|
|
|
04-13-2006, 02:09 PM
|
#3
|
Member
Registered: Mar 2003
Posts: 178
Original Poster
Rep:
|
Reply
I am playing around with a few accounts including one circumstance where I changed the permission to give write permission on the file, but none on the folder and I couldn't delete it anymore, so if the folder doesn't have write permission I can't write to a folder no matter what. So basically the only bit that seems to work on files is the executable bit correct? I mean if I don't have read/execute permission on the folder I can't go into the directory anyway and I'll have read permission since it would be inherited as well. I'm not opposed to this system, I'm just trying to understand it.
|
|
|
04-13-2006, 02:42 PM
|
#4
|
Member
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512
Rep:
|
Quote:
I am playing around with a few accounts including one circumstance where I changed the permission to give write permission on the file, but none on the folder and I couldn't delete it anymore, so if the folder doesn't have write permission I can't write to a folder no matter what.
|
You can write to the file. Open it in $EDITOR, make changes and save it. That should be no problem. You can't change the contents of the directory though, because you have no writing permission there.
|
|
|
04-13-2006, 06:14 PM
|
#5
|
Member
Registered: Mar 2003
Posts: 178
Original Poster
Rep:
|
Reply
I see what you mean. OK, this makes sense now. Thank you for your help.
|
|
|
04-14-2006, 11:20 AM
|
#6
|
Member
Registered: Sep 2003
Location: UK
Distribution: I use 'em all ;-)
Posts: 275
Rep:
|
File permissions:
r = read the contents of the file
w = modify the file
x = run the file as an executable
Directory permissions:
r = list the contents of the directory, but not 'ls' into it
w = delete or add a file in the directory
x = move into the directory
|
|
|
All times are GMT -5. The time now is 01:19 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|