LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-03-2005, 05:56 PM   #1
bpk
Member
 
Registered: Nov 2003
Location: San Francisco, CA
Distribution: FreeBSD, OpenBSD, Gentoo, OS X
Posts: 80

Rep: Reputation: 15
group sticky bits (confused on how, clear on concept)


Lots of users are writing from a directory, ie; /data/scans.

I'd like for every file in that directory to be owned by whomever wrote it, I don't care. But I'd like for every file to have the same group, ie; staff.

Whats the chmod command for that? I get so confused how to apply these things and the HOWTO's are confusing (to me).

Have a much better time learning through example.
 
Old 02-03-2005, 06:36 PM   #2
dsyd
LQ Newbie
 
Registered: Feb 2005
Posts: 15

Rep: Reputation: 0
use chgrp to change group properties, not chmod.

e.g. as root, cd to directory and chmod all files

su
..password
cd [dir]
chgrp [group] *
 
Old 02-03-2005, 06:37 PM   #3
dsyd
LQ Newbie
 
Registered: Feb 2005
Posts: 15

Rep: Reputation: 0
of course that will only work if you are root. you could add the script to cron config to make it run every hour or whatever?
 
Old 02-03-2005, 06:43 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Or just make the primary group of all users who write
to the directory staff ... saves you all the other hassles.



Cheers,
Tink
 
Old 02-03-2005, 06:49 PM   #5
bpk
Member
 
Registered: Nov 2003
Location: San Francisco, CA
Distribution: FreeBSD, OpenBSD, Gentoo, OS X
Posts: 80

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by dsyd
use chgrp to change group properties, not chmod.

e.g. as root, cd to directory and chmod all files

su
..password
cd [dir]
chgrp [group] *
Maybe im not explaining this correctly.

I'd like to change the sticky bit, so that when a file gets written to the directory, the group ownership will foreceully become whatever it's parent is.

Lets say Joe:Joe upload a file. The file would be owned by Joe and Group owned by Staff (not joe).

Understand?
 
Old 02-03-2005, 07:03 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
There is no unix/linux way of "inheriting" the
group ownership from the parent directory.


chmod 1775 /data/scans
chown root:staff /data/scans
usermod -g staff joe



Cheers,
Tink
 
Old 02-03-2005, 09:14 PM   #7
dsyd
LQ Newbie
 
Registered: Feb 2005
Posts: 15

Rep: Reputation: 0
i think this should work:

chgrp [group] ./
chmod g+s ./
 
  


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
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 06:02 PM
Java 64 bits and applications of 32 bits RGB_mdk Linux - Software 3 06-13-2005 10:05 AM
Group Admin, Group Root, or God over Group crickett Linux - General 5 07-12-2004 05:01 PM
Sticky Bits bluesbrothers AIX 1 04-27-2004 03:31 AM
controlling my sticky bits ridertech Linux - Security 1 01-02-2004 12:17 AM


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