Is it just me, or is Linux file-permissions incredibly simple to understand?
Linux - NewbieThis 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.
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.
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323
Rep:
Is it just me, or is Linux file-permissions incredibly simple to understand?
I seem to remember reading all kinds of posts, blogs and articles discussing how to understand the use of chmod and the numeric permission settings, each playing it up as cryptic and difficult to remember.
If I'm not mistaken, um, it's simply:
3 sections:
owner--group--other
3 settings per each section:
read--write--execute
Then for each section, the settings are determined by a 3 digit binary--1 for on, 0 for off. So read/no write/execute is 101, or 5.
Am I missing something, because it couldn't possibly be easier.
This is the bit that always gets me trapped up, it's "User, Group, Other" or UGO not OGO. For some reason, I just can't remember to associate U with Owner.
I think you've all hit this one pretty much on the head, minus the reason most people find this system cryptic. Many people have difficulty with linux permissions simply because they're referred to often by the chmod 3 digit parameter, instead of those useless GUIs and checkboxes windows babies are so accustomed to...
What about the chroot command? I find that a one harder to understand.
I know that it isolates a certain area of a filesystem. I guess if you wanted to make say
/home/user the root directory, then the user wouldn't only be able to go up to the user directory and everything below it? So
chroot /home/user /bin/bash
would open up a shell whereby if the user were to input cd / it would take the user to /home/user instead of the actual / (top of the tree)??
I have trouble understanding the use for this command?
Example 1:
If you run a webserver for hosting where users have remote access using ssh, you don't want them to snoop around too much (e.g. find out who other users on that server are by inspecting '/etc/password').
Example 2:
It's also useful for maintenance. Boot from install or live CD, chroot to the root dir on HD and do your maintenance without having to think to much about the path (mountpoints). '/etc/passwd' is now indeed the '/etc/passwd' of the system under maintenance and not a file on CD.
you've pretty much got it, chroot jails directory structures so that other users can't traverse them... this is useful for security or maintenance with rescue CD's because you can mount a file system directly at the / mount point. Solaris Jails work in a similar fashion but are more secure.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.