Yes to do what you need you simply need to change the xdg configuration for each existing user like so:
~/.config/user-dirs.dirs
XDG_DESKTOP_DIR="$HOME/Desktop"
...
XDG_MUSIC_DIR="/home/common/Music"
XDG_VIDEOS_DIR="$HOME/Movies"
And to make this something available to all users created simply edit this:
/etc/xdg/user-dirs.defaults
DESKTOP=Desktop
...
MUSIC=../common/Music
VIDEOS=Videos
To modify the permissions, this bit is tricky because you need to make sure that all files created in these directories remain editable by everyone. I found this interesting guide on the subject:
http://www.centos.org/docs/2/rhl-rg-en-7.2/s1-users-groups-private-groups.html
Which suggests doing the following to make the permissions sticky as well as adding the users all to a common group:
chown nobody:users /home/common
chmod 2775 /home/common
usermod -a -G users user1
You may want to change the umask setting to allow all files created to be modifiable by the anyone in the users group in that directory, edit /etc/profile
and go to the bottom and change umask 022
to umask 002
This is considered secure since all users have their own primary user and really only effects shared directories like this one you want to make.
Let us know if it works well enough.
The file /etc/nsswitch.conf
will let you reconfigure the order of the name resolution. By default, the host file is the first, then the configured DNS. There could be more options.
The file /etc/hosts
only lists IP addresses and hostnames (multiple names for one IP if you want)
The file /etc/resolv.conf
will list the default search domains, and will also list in sequence the name servers to use.
Best Answer
The
/etc/hosts
file is for mapping hostnames to IP addresses before DNS can be referenced. So the answer is no.Would a hard link in your directory to
/etc/hosts
not accomplish that? Something like this (where shared-directory will be your synch folder):The only difference in approach is that you then share 1 of your actual host files with all the other systems. And not a copy in your home directory.