LinuxQuestions.org
Help answer threads with 0 replies.
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 12-17-2008, 06:49 PM   #1
lumix
Member
 
Registered: Mar 2007
Distribution: Hardy (Gnome on Ubuntu 8.04) on Compaq N600c laptop
Posts: 323

Rep: Reputation: 30
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.
 
Old 12-17-2008, 06:52 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by lumix View Post
3 sections:
owner--group--other
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.
 
Old 12-17-2008, 07:20 PM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
don't forget the suid parameter of 4 that goes in front of the three sets that is if you wanted to add suid.
I.E. 4755 = 4 for suid 7(rwx) 5(rx) 5(rw)
 
Old 12-17-2008, 09:40 PM   #4
gankoji
Member
 
Registered: Nov 2007
Location: Southern California
Distribution: Slackware-13.0 x86_64, Slackware 12.2, slackware64-current
Posts: 225

Rep: Reputation: 35
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...
 
Old 12-17-2008, 09:56 PM   #5
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
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?
 
Old 12-17-2008, 11:53 PM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
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.
 
Old 12-17-2008, 11:55 PM   #7
shanecraddock@gmail.com
LQ Newbie
 
Registered: Dec 2008
Posts: 10

Rep: Reputation: 0
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.
 
  


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
linux understand different file systems diwakars Linux - Newbie 9 06-14-2008 02:00 PM
File Permissions Questions / SIMPLE HELP ME! vonedaddy Linux - Newbie 6 12-21-2007 04:59 AM
Don't quite understand The File Hierarchical System in Linux? jacatone Linux - Newbie 3 08-07-2005 09:55 PM
Permissions error message I dont understand? BajaNick Linux - Security 5 02-16-2005 08:12 PM

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

All times are GMT -5. The time now is 05:16 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