Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Solved] Question re: setting up shared family storage
-
- Posts: 34
- Joined: 2020-04-18 08:11
[Solved] Question re: setting up shared family storage
Hello Debian community,
I have another n00b question if I may:
I have installed and configured Buster on my T440p and everything is now running GREAT. I really like Gnome Desktop and Debian feels like such a solid choice of a distro - I am very chuffed by the prospect of using and learning it as the days go by.
This laptop will be used by various members of my family and my plan was to create a media type partition where all users could store and share with each other photos/videos (possibly documents) in a directory structure similar to a regular home folder but with rw access for everybody.
When I installed Buster I chose to encrypt my / partition not realising I would not be able to (easily) resize it later to create said storage partition. So my question is: what is the best practice example of setting up this shared directory and, more specifically, where should it be located? Reading up on the linux directory hierarchy I am unsure which directory to place it in. Presumably it won't be a user folder so /home isn't right. I was thinking about /var or /srv or possibly creating a "shared storage" folder in /.
I would then symlink that directory to all /home folders on the system.
Sorry if this is really basic but I would like to get this done correctly. Perhaps I may be overthinking this as well and would appreciate having that pointed out to me.
Thank you!
I have another n00b question if I may:
I have installed and configured Buster on my T440p and everything is now running GREAT. I really like Gnome Desktop and Debian feels like such a solid choice of a distro - I am very chuffed by the prospect of using and learning it as the days go by.
This laptop will be used by various members of my family and my plan was to create a media type partition where all users could store and share with each other photos/videos (possibly documents) in a directory structure similar to a regular home folder but with rw access for everybody.
When I installed Buster I chose to encrypt my / partition not realising I would not be able to (easily) resize it later to create said storage partition. So my question is: what is the best practice example of setting up this shared directory and, more specifically, where should it be located? Reading up on the linux directory hierarchy I am unsure which directory to place it in. Presumably it won't be a user folder so /home isn't right. I was thinking about /var or /srv or possibly creating a "shared storage" folder in /.
I would then symlink that directory to all /home folders on the system.
Sorry if this is really basic but I would like to get this done correctly. Perhaps I may be overthinking this as well and would appreciate having that pointed out to me.
Thank you!
Last edited by FOSS-15-Great on 2020-04-20 09:38, edited 1 time in total.
-
- Global Moderator
- Posts: 2684
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 41 times
- Been thanked: 196 times
Re: Question re: setting up shared family storage
Create the shared directory in /home, as in /home/share. Then create a new user group to own that share, the 'share' group. Make each user a member of the share group and then will have access to the share directories. 'share' can be any name. Each use can navigate there or do links. A full directory tree can be in there, however you need it to appear.
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: Question re: setting up shared family storage
Brilliant - thank you!CwF wrote:Create the shared directory in /home, as in /home/share. Then create a new user group to own that share, the 'share' group. Make each user a member of the share group and then will have access to the share directories. 'share' can be any name. Each use can navigate there or do links. A full directory tree can be in there, however you need it to appear.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
If you want everybody to be able to edit files in that directory then you'll also have to apply the setgid bit and change the umask for your users.
See https://forum.mxlinux.org/viewtopic.php ... 34#p567834
See https://forum.mxlinux.org/viewtopic.php ... 34#p567834
deadbang
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: [Solved] Question re: setting up shared family storage
Brilliant, thank you. None of my users (including me) have a ~/.xsessionrc file. If I add one at the ~/ location is it enough to add the line you mentioned in the linked forum post? Seeing that I use GDM do I need to configure it at all?Head_on_a_Stick wrote:If you want everybody to be able to edit files in that directory then you'll also have to apply the setgid bit and change the umask for your users.
See https://forum.mxlinux.org/viewtopic.php ... 34#p567834
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
If you're using GNOME then just un-comment & edit the umask line in ~/.profile.
deadbang
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: [Solved] Question re: setting up shared family storage
Just double-checking this after re-reading your previous post (and the linked on on the MX Linux forum):
Should the uncommented line in ~/.profile say 022 (the default entry) or should it be edited to 002 (as in the post you linked to on the MX Linuz forum.
Should the uncommented line in ~/.profile say 022 (the default entry) or should it be edited to 002 (as in the post you linked to on the MX Linuz forum.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
^ This. Read the umask(2) man page to find out what that means.FOSS-15-Great wrote:should it be edited to 002
deadbang
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: [Solved] Question re: setting up shared family storage
Thank you - I have been reading up on umask and chmodHead_on_a_Stick wrote:^ This. Read the umask(2) man page to find out what that means.FOSS-15-Great wrote:should it be edited to 002
Unfortunately, the setup is not working as it is supposed to.
These are the steps I have taken:
- su - root and create directory 'shared' in /home
-
Code: Select all
groupadd shared chgrp -R shared /home/shared chmod -R g+ws /home/shared
- added users to group shared
- edited and uncommented in ~/.profile for all users
Code: Select all
umask 002
Code: Select all
drwxrwsr-x 2 root shared 4096 May 13 09:00 shared
So I set
Code: Select all
chmod775
When I type
Code: Select all
umask
Code: Select all
0022
- I should be editing ~/.profile to 0002
- or that the umask entry is read from a place other than ~/.profile?
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
I've just tested my suggestions (again) with a new user & the GNOME desktop and it all works as it should. No idea why you're having problems.
deadbang
Re: [Solved] Question re: setting up shared family storage
^ I think this.FOSS-15-Great wrote:Code: Select all
drwxrwsr-x 2 root shared 4096 May 13 09:00 shared
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
Code: Select all
empty@E485 ~ % ls -ld /home/shared
drwxrwsr-x 2 root shared 6 May 13 15:40 /home/shared
empty@E485 ~ %
deadbang
Re: [Solved] Question re: setting up shared family storage
Yes, those 's's, I rarely use them, thanks for correcting HOAS.
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: [Solved] Question re: setting up shared family storage
arzgi wrote:^ I think this.
Head_on_a_Stick wrote:^ That works for me.
I am not following, sorry. Do you mean the "s" in rws?arzgi wrote: Yes, those 's's, I rarely use them, thanks for correcting HOAS.
I am still struggling to understand why this isn't working.
the shared folder has permissions and gid set correctly but when I create, save or copy a file into the directory the folder's permissions aren't applied to the files inside. Is this a problem of umask?
I am using GDM on X11 (I installed NVIDIA drivers on Optimus laptop and GDM automatically switched from Wayland to X11).
Here is what my .profile looks like:
Code: Select all
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
umask 002
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: [Solved] Question re: setting up shared family storage
Yes, my suggestion won't work unless the umask is set to 002. Both the X & Wayland sessions for GNOME obey ~/.profile in my Debian buster box but if you're using the X session then you can try adding the umask line to ~/.xsessionrc instead.FOSS-15-Great wrote:Is this a problem of umask?
/etc/pam.d/login can also set the default umask but that doesn't work for me.
deadbang
-
- Posts: 34
- Joined: 2020-04-18 08:11
Re: [Solved] Question re: setting up shared family storage
Thank you for clearing that up. I edited ~/.bachrc according to the Debain user manual and now the umask setting for every user shows correctly asHead_on_a_Stick wrote:Yes, my suggestion won't work unless the umask is set to 002. Both the X & Wayland sessions for GNOME obey ~/.profile in my Debian buster box but if you're using the X session then you can try adding the umask line to ~/.xsessionrc instead.
Code: Select all
umask 0002
However, the problem persisted across multiple logins and logouts. Eventually I rebooted the machine and at the next login the permissions were set correctly. I still have to figure out why my ~/.profile umask entry was not being obeyed but I will leave that for another day.