LinuxQuestions.org
Help answer threads with 0 replies.
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 03-05-2013, 01:13 AM   #1
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Rep: Reputation: Disabled
Thumbs up creating folders and permissions SGID


Hello all, I am trying to-->
Create a folder in home directory called data. Change the group owner of the data folder to the users group, and set the special permission SGID on the directory.

So far this is what i got...
create data folder:
md data
Change to # user to change data owner group:
su -
check my group name and change data to it:
group myname or id myname
chown myname:users data

So how do i set special permission SGID ? and how does this effect my data folder ?

If there are mistakes lemme know Thx
Havent tested this completely...
My laptop doesnt have enough ram keeps crashing VM9. Setting up desktop now.

Thanks in advanced

Last edited by TechJay; 03-05-2013 at 01:14 AM.
 
Old 03-05-2013, 01:23 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Code:
chmod g+s /home/myname/data
What it does is force any files created by any other user in that group to have the same group ownership as the dir.
Note that it would be unusual to use this in your personal home dir.
Its usually used as part of creating an acct for a project group, so they can safely/easily share files.
You'd have owner = myproj, group=myproj and add the group s flag to the perms as above.
Note that owners and groups are in separate name spaces, so they can have the same 'name'.
Usually only the proj/team lead will have the proj acct passwd; no need for anyone else to know it.
 
1 members found this post helpful.
Old 03-05-2013, 01:39 AM   #3
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Original Poster
Rep: Reputation: Disabled
Thanks! So lemme get this straight,
I create the folder data, change the group to users, and the 'chmod g+s /home/myname/data' command changes the data folders group permissions so that any file created by any user under the data directory will inherit the data ownership ?

Last edited by TechJay; 03-05-2013 at 01:50 AM.
 
Old 03-05-2013, 01:54 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Yes, pretty much eg http://www.expertslogin.com/hwtos/stickbit-suid-guid/. NB only affects files/dirs created in data dir AFTERWARDS; ie its not retrospective
 
1 members found this post helpful.
Old 03-05-2013, 02:37 AM   #5
TechJay
LQ Newbie
 
Registered: Mar 2013
Location: WV
Distribution: Fedorra Goddard for now
Posts: 27

Original Poster
Rep: Reputation: Disabled
thanks very informative... i understand now.... the examples u found were nmuch more clear than the others i googled... thank u
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] folder permissions and sgid knottulf Linux - Newbie 11 10-22-2012 08:52 AM
Permissions when creating files&folders rbalaa Linux - Newbie 3 04-09-2011 06:50 PM
Creating Folders JJV Linux - Newbie 7 02-21-2008 10:44 AM
LXer: Setting the SUID/SGID bits: Giving a program YOUR permissions when it runs LXer Syndicated Linux News 0 03-09-2007 08:16 PM
change permissions of all folders and sub folders cad Linux - General 3 01-28-2007 11:21 AM


All times are GMT -5. The time now is 10:41 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration