0

What I want to do is link/merge folders. The two folders I want to combine are

/home/user1/Pictures 
/home/user2/Pictures

I want all these family photos to be stored in a single location and be easily accessible from every user account. I tried the ln command but it didn't work because owners of both folders are different, so there's no access permission via the symlink.

0

1 Answer 1

0

You can create a shared folder and set permissions so that all users can access it. For convenience you can also create links in users' home directories to that folder.

Go to /home and make a new directory

sudo mkdir /home/pictures

Then set permissions and ownership to make the folder accessible and writeable by all users (note that this is a security risk - it makes it possible for any user or process to modify the contents of the directory and add or delete content)

sudo chmod 777 /home/pictures
sudo chown nobody /home/pictures

Then add the content as desired.

A more secure method would be to create a group with all real users, for example:

sudo addgroup pictures
sudo adduser user1 user2 pictures

And set the permissions of the /home/pictures directory like this:

sudo chown :pictures /home/pictures
sudo chmod 775 /home/pictures

With these settings, only group members and root will be able to write to the directory, though it will remain readable for guests and other processes (so a program that set your wallpaper would be able to read from it, for example).

Then you can create links to access that folder, or user can create

ln -s /home/pictures /home/user1/Family_pictures

When user1 tries to access Family_pictures they will see the contents of the shared directory,

Not the answer you're looking for? Browse other questions tagged .