Where should I place group shared files on a Linux system?
I'm migrating a lot of small custom scripts and data from a Linux system to another.
On the old system we had a shared user that owned most of the files and they where located in that users /home
, but on the new one we would rather login with our own accounts and use group permissions to collaborate, but as there won't be a single owner of the files, there is no /home
-dir.
So where should I put those shared files? Should I create a no-login-user that owns the files? Or is there a suitable /grouphome
-like place?
(I don't want to spread them out in individual users /home
:s.)
Solution 1:
I'd almost certainly suggest using /usr/local
.
Globally accessible user scripts can be placed in /usr/local/bin
. Small amounts of associated data could also go into bin
. Or you may wish to separate out the data into /usr/local/var
or /usr/local/share
.
By doing this you'll be quite sure that anyone FHS familar will be able to locate them pretty quickly without any prior knowledge of the particular system.
Solution 2:
It is exactly the sort of thing that group rights are designed for. This is how I do it in Ubuntu:
sudo mkdir /home/shared
sudo addgroup shared
sudo chown :shared /home/shared
sudo chmod 770 /home/shared
sudo vim /etc/group
Add the list of users who are to have access to the shared directory to the shared group. For example:
shared:x:1002:norman,nextuser,and,so-on
You can, of course, use any name other than 'shared' and it does not have to be in the /home directory. The nice thing is that you don't need to do anything special to the user's accounts and you can easily add or remove users from the group.
Solution 3:
The short answer is; Wherever you like :)
I like to use something like /projects, /shared or /common. /home/shared works too.