LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices


Reply
  Search this Thread
Old 08-17-2004, 04:08 AM   #16
jbristle
LQ Newbie
 
Registered: Aug 2004
Location: Eden Prairie, MN
Distribution: Mandrake, Fedora, Suse, Debian
Posts: 1

Rep: Reputation: 0
Smile Re: DISCUSSION: Quick and Dirty Guide to Linux File Permissions


Quote:
Originally posted by bulliver
This thread is to discuss the article titled: Quick and Dirty Guide to Linux File Permissions
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.
 
Old 08-17-2004, 11:40 AM   #17
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
Hi this is rally nice. I havent been to the Answers page ina while and so I saw this recently. Nicely done.

Cheers and thanks.
 
Old 08-27-2004, 12:28 AM   #18
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
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.......
 
Old 08-29-2004, 08:10 PM   #19
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
I think bulliver has done a great job, and since chattr is
ext2/3 specific it doesn't really belong into an article on
Linux permissions at all ...



Cheers,
Tink
 
Old 08-30-2004, 05:08 AM   #20
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
Thanks for the positive feedback everyone.

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"

 
Old 08-30-2004, 01:46 PM   #21
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 34
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.........
 
Old 09-12-2004, 08:26 AM   #22
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Rep: Reputation: 15
Warning!!! Noob here!

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?

Maybe I should read it 2 more times...
 
Old 09-12-2004, 03:04 PM   #23
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
Kanon:

Have a look at a permission string:

-rwxr-xr-x

You can see there are 10 slots. The first one (generally) describes the file. It is a simple dash for plain files.

Then we have three groups of three permissions in the order:
owner group other

each of these groups has three permissions:
read write execute

read permission => 4
write permission => 2
execute permission => 1
NO permissions (ie '-') => 0

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 ]

So our final permissions for the file are 755

Hope this clears it up....

Last edited by bulliver; 09-12-2004 at 03:09 PM.
 
Old 09-12-2004, 05:19 PM   #24
Kanon
Member
 
Registered: Sep 2004
Location: Norge
Distribution: Debian
Posts: 116

Rep: Reputation: 15
Quote:
Originally posted by bulliver
read permission => 4
write permission => 2
execute permission => 1
NO permissions (ie '-') => 0

AH! Yes, it's crystal now!

All I have to do now is: remember.
But I did bookmark it!

Tnx for the input!
 
Old 04-22-2005, 07:56 AM   #25
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
Great guide

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

With regards ALInux
 
Old 04-22-2005, 08:20 AM   #26
raxxal
Member
 
Registered: Jul 2004
Location: Los Angeles
Distribution: Mandrake 2007
Posts: 109

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


Raxxal
 
Old 05-02-2005, 04:30 PM   #27
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Rep: Reputation: 15
What I didn't understand/see was anything about changing permissions for directory's and their contents.

I just did a reinstall/upgrade and from disks reloaded all the files I needed.

They are all now read-only by user.
I can go in a change each one individually but is there a way to change an entire directory?
Jay
 
Old 05-02-2005, 05:17 PM   #28
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

Rep: Reputation: 78
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/*
 
Old 05-14-2005, 08:50 PM   #29
mgouin
LQ Newbie
 
Registered: Jun 2004
Distribution: Mandrake 9.2
Posts: 2

Rep: Reputation: 0
s file attribute ?

First : thank you for this article.
I also have a question. I found a file on my system which is this :

-rwsr-xr-x 1 root root 481196 Jul 21 2004 /usr/bin/smbumount2

I just don't understant what the "s" mean in place of the "x" position.
Is anybody knows ?

Thanks,
Matthieu
 
Old 05-15-2005, 02:22 AM   #30
bulliver
Senior Member
 
Registered: Nov 2002
Location: Edmonton AB, Canada
Distribution: Gentoo x86_64; Gentoo PPC; FreeBSD; OS X 10.9.4
Posts: 3,760

Original Poster
Blog Entries: 4

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


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
DISCUSSION: A Short Guide to Partitioning a Hard Drive for a Linux System moses LinuxAnswers Discussion 33 07-06-2014 12:36 PM
DISCUSSION: Quick and Dirty Backups jeremy LinuxAnswers Discussion 2 03-10-2006 10:56 AM
Quick and dirty cryptography guide. Linux.tar.gz Linux - Security 4 03-25-2005 02:16 PM
quick and dirty guide on installing GRUB markus1982 Linux - Software 1 05-26-2003 11:56 AM
quick and dirty guide on installing grub markus1982 Linux - General 0 04-10-2003 03:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion

All times are GMT -5. The time now is 05:22 AM.

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