LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-01-2010, 10:01 PM   #1
zoran119
Member
 
Registered: Dec 2007
Posts: 217

Rep: Reputation: 18
Angry why is it so hard to have a shared directory!?!?!?


ok, all i want is a directory to which users who are members of a group can all write and write to each other's files (so like a public directory).

in addition, i would like to keep the slackware's 022 umask value.

one of the things i thought might be able to do it acls. i was almost there with it but even though i set the default mask value to rwx, newly created files get the effective permissions which are same as using the 022 umask. i don't really see the point of acls for newly created files... the effective mask is applied before the default acl permissions rendering the default permissions useless (sort of).

anyway, the only way to do what i want is to maybe run a samba service and get the users to use the directory through samba (where i'd set more relaxed umasks) so similar approach.

so, is there a way to do this in an easy way?

note: i'd classify using acls the easy way as long as i could stop it from making the effective masks
 
Old 08-01-2010, 10:40 PM   #2
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309

Rep: Reputation: 234Reputation: 234Reputation: 234
To share files with the other users -- the members of users group -- I prepared a common directory and changed it's rights to 775. When I put there some file and I want to able the other users to write to it I change it's rights to 664. The other users do the same. It isn't the perfect solution but in my case it works well.
 
Old 08-02-2010, 10:02 AM   #3
TSquaredF
Member
 
Registered: Dec 2005
Location: "The South Coast of Texas"
Distribution: Slackware64-current
Posts: 564

Rep: Reputation: Disabled
I have an hourly cron job on the file server as so:
Code:
chown -R user:group /mnt/filedir/*
find /mnt/filedir -type f -print0 | xargs -0 /usr/bin/chmod 664
find /mnt/filedir -type d -print0 | xargs -0 /usr/bin/chmod 775
This way anyone in "group" can write to the shared "filedir" & everyone can read it. The permissions are not right between the time the file is written & the cron job runs. An hour works OK in my case, you may have to shorten the time.
Regards,
Bill
 
Old 08-02-2010, 10:08 AM   #4
rg3
Member
 
Registered: Jul 2007
Distribution: Fedora
Posts: 527

Rep: Reputation: Disabled
Quote:
in addition, i would like to keep the slackware's 022 umask value.
That's why.
 
Old 08-02-2010, 07:35 PM   #5
zoran119
Member
 
Registered: Dec 2007
Posts: 217

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by rg3 View Post
That's why.
is it dangerous to change the umask to 002? i'd only do it for a couple of users that need to share the files.
 
Old 08-02-2010, 07:43 PM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
In order to give members of your group change permissions in Windows, you must give at least rxwrwx--- to that file. That is, execution permissions on that file.

The best solution to get the correct permissions for all group members is to create a directory, and set the setgid bit on that directory. Then every file in that directory will inherit the permissions from that directory when it is created.

It is by far the easiest solution for such a shared drive.

You set the setgid bit by:
Code:
chmod g+s
The directory shows up like
drwxrwS---

Note the lower case 's' . An capital 'S' means rwxrw---- (without 'X') on the directory. A lower case 's' means rwxrwx--- plus 's'

jlinkels

Last edited by jlinkels; 08-02-2010 at 07:47 PM.
 
1 members found this post helpful.
Old 08-02-2010, 07:48 PM   #7
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
Quote:
Originally Posted by zoran119 View Post
is it dangerous to change the umask to 002?
Yes it is dangerous, unless done right. Everyone who uses 002 needs to have a unique primary group. Otherwise, files they create will be writable by others that should not have write access.
 
Old 08-02-2010, 07:48 PM   #8
zoran119
Member
 
Registered: Dec 2007
Posts: 217

Original Poster
Rep: Reputation: 18
Quote:
Originally Posted by jlinkels View Post
The best solution to get the correct permissions for all group members is to create a directory, and set the setgid bit on that directory.
but other users cannot write to files if the user creating the file has a umask of 022 (slackware default).
 
Old 08-02-2010, 07:51 PM   #9
DJ Shaji
Member
 
Registered: Dec 2004
Location: Yo Momma's house
Distribution: Fedora Rawhide, ArchLinux
Posts: 518
Blog Entries: 15

Rep: Reputation: 106Reputation: 106
Acl's are over kill, I think. A combination of permissions should do the trick.
 
  


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
shared directory - xp/ubuntu tigertim71 Linux - Newbie 4 02-15-2009 04:37 PM
Shared directory. How? beli0135 Linux - Networking 3 08-07-2008 06:30 PM
shared directory allelopath Linux - Networking 7 03-19-2006 02:01 PM
Shared directory Sir.Del Linux - General 1 07-27-2004 12:35 PM
Problem with shared directory Tezdread Linux - Networking 5 03-16-2004 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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