Re: [Dorset] How can I reproduce the properties of Windows "Shared Documents" directory in Linux?

2014-08-25 Thread John Carlyle-Clarke
Either of the previous suggestions sound good, but here's how I've always
done it.

(1) Ensure the users you want to share the directory have membership of an
additional common group. One Debian systems like Ubuntu, each user e.g.
john gets a group with the same name ("john") as their primary group. Check
the groups you're in already by typing "groups" at a shell. "users" would
be a good option, assuming it exists. If you're not in this group, do this
to add the user "jd":-

usermod -aG users jd

(2) Change the default umask to 002 as Ralph described.

(3) For the shared directory, do:-
cd /shared
chgrp -R users *
chmod -R g+w *
find -type d chmod g+s

This makes all the files have the group "users" and be group writeable. It
then sets the group setuid bit on the directories, which has a special
meaning in this case. See
http://en.wikipedia.org/wiki/Setuid#setuid_and_setgid_on_directories

It means instead of files being created with the creating user's primary
group (which is the normal behaviour), they will inherit the parent's group
ID. So, the "users" group membership will apply to all files created there.
Combined with the umask, this means all members of "users" can read and
write all files there.

To be honest, it's not a bad idea to put the step (3) commands in a cron
job too as Ralph suggested, just to fix up any problems (usually caused by
doing stuff in there as root via sudo). Belt and braces!



On 25 August 2014 15:02, Neil Stone  wrote:

> On 08/25/14 14:32, JD wrote:
> > I'm on Ubuntu 14.04.  I want to convert my wife & myself from Windows
> > XP.  I think I can do almost everything to reproduce our accounts but
> > I can't create the equivalent of Shared Documents.
> >
> > This directory, in Windows, appears to contain objects that are owned
> > by nobody but everybody has read/write/create/delete permission on all
> > the files and directories in it.
> >
> > In Ubuntu I can't get rid of the ownership by an individual user and
> > the consequent permissions.
> >
> > I've tried to use Ubuntu's Public directory in my account but I can't
> > get it to retain the read/write permission for Others.  In my wife's
> > account sharing Public is prohibited even though I've made her an
> > administrator and therefore a member of sudo and sambashare.
> >
> > I've created /home/shared and made it usable by all but, of course,
> > items put in there retain their owners permissions.
> >
> > I guess that setting umask to an extreme value (is that 000 or 777?)
> > would do it but with enormous overkill!
> >
> > Please help to get my wife away from Windows!!! - preferably without
> > her noticing!
> >
> > Regards,
> > John
> >
>
> I would ensure that all users are primarily a member of the 'users'
> group and ensure that the umask set allows all 'users' members rw perms
> (umask 007)
>
>
> https://www.ibm.com/developerworks/community/blogs/brian/entry/every_possible_unix_linux_umask_mode_plus_scripts_to_generate_these_lists15?lang=en
>
>
> HTH
>
> Neil
>
> --
> Next meeting:  Bournemouth, Tuesday, 2014-09-02 20:00
> Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
> New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
> How to Report Bugs Effectively:  http://goo.gl/4Xue
>
-- 
Next meeting:  Bournemouth, Tuesday, 2014-09-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] How can I reproduce the properties of Windows "Shared Documents" directory in Linux?

2014-08-25 Thread Neil Stone
On 08/25/14 14:32, JD wrote:
> I'm on Ubuntu 14.04.  I want to convert my wife & myself from Windows
> XP.  I think I can do almost everything to reproduce our accounts but
> I can't create the equivalent of Shared Documents.
>
> This directory, in Windows, appears to contain objects that are owned
> by nobody but everybody has read/write/create/delete permission on all
> the files and directories in it.
>
> In Ubuntu I can't get rid of the ownership by an individual user and
> the consequent permissions.
>
> I've tried to use Ubuntu's Public directory in my account but I can't
> get it to retain the read/write permission for Others.  In my wife's
> account sharing Public is prohibited even though I've made her an
> administrator and therefore a member of sudo and sambashare.
>
> I've created /home/shared and made it usable by all but, of course,
> items put in there retain their owners permissions.
>
> I guess that setting umask to an extreme value (is that 000 or 777?)
> would do it but with enormous overkill!
>
> Please help to get my wife away from Windows!!! - preferably without
> her noticing!
>
> Regards,
> John
>

I would ensure that all users are primarily a member of the 'users'
group and ensure that the umask set allows all 'users' members rw perms
(umask 007)

https://www.ibm.com/developerworks/community/blogs/brian/entry/every_possible_unix_linux_umask_mode_plus_scripts_to_generate_these_lists15?lang=en


HTH

Neil

-- 
Next meeting:  Bournemouth, Tuesday, 2014-09-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue


Re: [Dorset] How can I reproduce the properties of Windows "Shared Documents" directory in Linux?

2014-08-25 Thread Ralph Corderoy
Hi John,

> I've created /home/shared and made it usable by all but, of course,
> items put in there retain their owners permissions.

Yes, moving a file to /home/shared won't change it from 0600, say, to
0666.

> I guess that setting umask to an extreme value (is that 000 or 777?)
> would do it but with enormous overkill!

It's `permissions &= ~umask', where `&' is bitwise-AND and `~' is
bitwise-NOT, IOW it's the bits to clear, like a BIC instruction.  That's
why

$ umask
0022
$

is the default value, clearing `w' for group and other from the default
permissions of 0666;  rw-rw-rw- &= ~w--w- is rw-r--r--.  Note, since
it's an octal number, it's often shown with a leading 0 to make this
clear.

So to have rw-rw-rw- remain untouched, you'd have a umask of 0;  yes,
not generally wanted.

How about having a cron job as root that runs every so often and fixes
up newly arrived files with the wrong permissions?

find /home/shared -type f ! -perm -22 -ls -exec chmod go=u {} +

You can try it manually, missing off the -exec... just to see what it
considers needs work.  The -ls output will be emailed to you by cron, so
you can see what's newly arrived and fixed;  remove it when boringly
content.

Be careful about doing this somewhere else;  mucking up permissions on a
wide scale is an easy way to break an installation beyond simple repair!

Cheers, Ralph.

-- 
Next meeting:  Bournemouth, Tuesday, 2014-09-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue


[Dorset] How can I reproduce the properties of Windows "Shared Documents" directory in Linux?

2014-08-25 Thread JD
I'm on Ubuntu 14.04.  I want to convert my wife & myself from Windows 
XP.  I think I can do almost everything to reproduce our accounts but I 
can't create the equivalent of Shared Documents.


This directory, in Windows, appears to contain objects that are owned by 
nobody but everybody has read/write/create/delete permission on all the 
files and directories in it.


In Ubuntu I can't get rid of the ownership by an individual user and the 
consequent permissions.


I've tried to use Ubuntu's Public directory in my account but I can't 
get it to retain the read/write permission for Others.  In my wife's 
account sharing Public is prohibited even though I've made her an 
administrator and therefore a member of sudo and sambashare.


I've created /home/shared and made it usable by all but, of course, 
items put in there retain their owners permissions.


I guess that setting umask to an extreme value (is that 000 or 777?) 
would do it but with enormous overkill!


Please help to get my wife away from Windows!!! - preferably without her 
noticing!


Regards,
John

--
Next meeting:  Bournemouth, Tuesday, 2014-09-02 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
New thread on mailing list:  mailto:dorset@mailman.lug.org.uk
How to Report Bugs Effectively:  http://goo.gl/4Xue