LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-13-2004, 11:40 AM   #1
InEeDhElPlInUx
Member
 
Registered: Sep 2003
Posts: 107

Rep: Reputation: 15
Just a quick question about permissions


When setting permissions for a filesystem to be mounted in fstab why do you have to use 4 numbers in the umask. ex: umask 0000. I know what the last 000 do, they give wrx permission to the owner, group and other but what is that first number for. Maybe someone can explain quickly to me what it's for. Thanks!
 
Old 04-13-2004, 11:47 AM   #2
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
First number is for the setuid, setgid, and the sticky bit. Example:
You know the last numbers work like this:
4=r,2=w,1=x. 'rwx'=7, 'rw-'=6, 'r--'=4. Thus you have the three numbers, '777', which means 'rwxrwxrwx'.
The first digit is similar, I think it goes like this; 4=setuid, 2=setgid, 1=sticky bit
setuid: if this is enabled, then the program is run as the same user as the user who owns the file
setgid: if this is enabled, then the program is run as the group that owns the file
sticky bit: cache this file in the swap, not used for what it was meant for anymore, sometimes used for other things
 
Old 04-13-2004, 01:58 PM   #3
InEeDhElPlInUx
Member
 
Registered: Sep 2003
Posts: 107

Original Poster
Rep: Reputation: 15
how is setuid, setgid and stick bit used. Give me an example of when you would use it.
 
Old 04-13-2004, 02:07 PM   #4
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
For example, if regular users needed to run a program as root: the setuid would be enabled on the program file, and the program would be owned by root. Then the program can be run as root by anyone.

The sticky bit is something old. It once ws meant for caching files in the swap. For example, if a program had the sticky bit enabled, the kernel would keep it in swap, supposedly for faster access. It doesn't do this anymore, and the sticky bit is ignored on files. On folders, however, it has a completely different function that still works (search it).
 
Old 04-13-2004, 02:57 PM   #5
InEeDhElPlInUx
Member
 
Registered: Sep 2003
Posts: 107

Original Poster
Rep: Reputation: 15
Thanks!
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Quick and Dirty Guide to Linux File Permissions bulliver LinuxAnswers Discussion 32 12-19-2011 10:36 PM
Question Concerning ISO's and one quick question. evrae Linux - Software 2 06-21-2004 03:53 AM
Quick permissions question Jestrik Linux - General 3 03-27-2004 01:54 PM
samba smb.config question (quick question) TheDOGG Linux - Networking 1 03-02-2004 07:19 AM
Quick Samba permissions question jamespetts Linux - Networking 2 10-07-2002 05:25 AM

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

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