LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-29-2006, 11:07 PM   #1
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Rep: Reputation: 0
sgid and sticky bit


i new in linux, i want ask:
how to use sgid and sticky bit for special permission ?
 
Old 05-30-2006, 01:20 AM   #2
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
What specifically are you trying to do? In general, the sticky bit is set for world writable directories (i.e. anyone can access and change the directory contents) and the suid and sgid bits are set for executable files (e.g. PERL scripts).

What the sticky bit does to a world writable directory is limit any changes that a user might want to make to that directory to only the files that the user owns. In other words, any user can make any changes to the directory, but only to files that they own in that directory. A good example of the sticky bit in action is the /tmp directory.

When the suid and sgid bits are set for an executable file, the executable file runs with the privileges of the file's owner and/or group, depending on which bits are set. This can be quite useful for a PERL script on a website because it will allow the script to access data that the caller of the script (i.e. the web surfer) can be prevented from accessing. In other words, it greatly enhances a website's security.
 
Old 05-31-2006, 08:58 PM   #3
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xode
What specifically are you trying to do? In general, the sticky bit is set for world writable directories (i.e. anyone can access and change the directory contents) and the suid and sgid bits are set for executable files (e.g. PERL scripts).

What the sticky bit does to a world writable directory is limit any changes that a user might want to make to that directory to only the files that the user owns. In other words, any user can make any changes to the directory, but only to files that they own in that directory. A good example of the sticky bit in action is the /tmp directory.

When the suid and sgid bits are set for an executable file, the executable file runs with the privileges of the file's owner and/or group, depending on which bits are set. This can be quite useful for a PERL script on a website because it will allow the script to access data that the caller of the script (i.e. the web surfer) can be prevented from accessing. In other words, it greatly enhances a website's security.

I have four user is:
- jack with secondary group manager, sysadmin, admin, webdev
- jenny with secondary group admin
- brian with secondary group webdev, sysadmin
- steven with secondary group sales
i want jenny couldn't access webdev and sysadmin then brian couldn't access admin
 
Old 05-31-2006, 09:27 PM   #4
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
Quote:
From levis_inferno

i want jenny couldn't access webdev and sysadmin then brian couldn't access admin
Could you make this more clear. What you wrote here makes no sense to me.
 
Old 06-01-2006, 12:51 AM   #5
levis_inferno
LQ Newbie
 
Registered: May 2006
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by xode
Could you make this more clear. What you wrote here makes no sense to me.
- user jenny can't access to webdev and sysadmin group
- user brian can't access to admin group
 
Old 06-01-2006, 01:00 AM   #6
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 638
Blog Entries: 1

Rep: Reputation: 52
Set your users up as follows?:

- jack with secondary group manager, sysadmin, admin, webdev
- jenny with secondary group sysadmin, admin, webdev
- brian with secondary group admin, webdev, sysadmin
- steven with secondary group sales
 
  


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
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Sticky Bit Doesn't Seem to work krishvij Linux - Newbie 5 05-10-2005 05:31 PM
Mount a raid array with SGID bit set, howto? anand_kt Linux - General 4 04-01-2005 01:30 AM
Sticky Bit tarballed Linux - General 4 07-03-2002 03:54 PM
sticky bit motiram Linux - General 1 08-01-2001 12:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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