DISCUSSION: Quick and Dirty Guide to Linux File Permissions
LinuxAnswers DiscussionThis forum is to discuss articles posted to LinuxAnswers.
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.
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.
I have been looking for a page like this. I have been trying to set permissions on files so my Windows machine and rest of the family could access directories and files on my Linux machine and kept failing permissions and couldn't figure out why. This is great.
I agree that article explains file permissions in a way a noob can understand........................When I first read the article (quite a few months ago), the light suddenly went on in my head about the way permissions work in the unix world..............Before that, I was perceiving it as being harder than it actually is.......
I have to agree with Tinkster. I wanted it too be very bare-bones and to the point, after all it's the "Quick and Dirty Guide to Linux File Permissions" not the "Long and Drawn Out Guide to Linux File Permissions"
Maybe someone could write another article about the chattr, extended attributes, Access Control Listss. and any other more specialized and exotic methods used for permissions as a compliment to this article, if they're so inclined..........I don't have any experience with any of them using reiserfs, or I might do it.........
Great article!! Finaly someone have put together everything in one file! I'v googled and found them all separatly. So this really helps! (bookmarking it now)
One thing I dont understand is how do you know its 755? Why 7? and why 5? Where does these numbers come from?
It's just basic math. Have a look at our permission string again:
-rwxr-xr-x
The first slot is a dash: '-', so it is a regular file.
The next three slots describe the file owners permissions: 'rwx'
4 + 2 + 1 = [ 7 ]
The next three slots describe the file's group permissions: 'r-x'
4 + 0 + 1 = [ 5 ]
The next three slots describe everyone else's permissions: 'r-x'
4 + 0 + 1 = [ 5 ]
come on guys Iam a little bit advance newbie
but I really found the article very helpful, since it was plain simple informative and the author did stick to the point of permissions or modes and did not talk about this and that like many other how tos
Originally posted by thegeekster Maybe someone could write another article about the chattr, extended attributes, Access Control Listss. and any other more specialized and exotic methods used for permissions as a compliment to this article, if they're so inclined..........I don't have any experience with any of them using reiserfs, or I might do it.........
Don't forget to include lcap as well. With lcap, not even root can restore, let's say, /var/log/messages apend only feature, unless root reboot the machine and disable the append only feature of a file.
That is a good point. I neglected to say that permissions on directories work a bit different...
r permissions on a directory lets you list the directory
w permissions on a directory lets you create and remove files in the directory
x permissions on a directory lets you traverse a directory (ie: cd into it)
However, because the permissions mean different things when talking about directories as opposed to regular files, running a recursive chmod: 'chmod -R 755 /directory' to modify the permissions of the files inside the directory may not work as you anticipated, because it will adjust the directory (and subdirectories) as well. In this case your best bet is to use shell-globbing:
$ chmod 755 /directory/*
It means that the file is set SUID to run as root. Some files, such as /etc/passwd need to run SUID so that you can change your own passwd (ie: a regular user cannot edit the file).
In your case, the smbumount2 needs root permissions to run.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.