0

Can I put a folder in the top of the main drive (is that the root?) so that the two users of the machine can use it freely. For example, I'd like to put music in it so that both users can import to Rhythmbox. We also need to keep other various files and docs there and we need to edit files created by eachother.

I'm not magnificently knowledgeable of term commands, so if someone could give me reasonably detailed instructions, I'd be very grateful.

If there's a better way to do what I want; I'm listening...

Many thanks.

Using Ubuntu 18 (if you want to help with my Ubuntu<>MacOS filesharing problem, please look for my other post).

spaceprobe
  • 11
  • 1
  • 4
  • See also https://joshua14.homelinux.org/blog/?p=1383 . There are several options, SGID and groups are easiest, ACL and (or) bindfs are alternates. – Panther May 15 '18 at 14:05
  • See https://askubuntu.com/questions/52584/how-do-i-set-up-a-folder-so-that-anything-created-in-it-inherits-permissions and http://brunogirin.blogspot.com/2010/03/shared-folders-in-ubuntu-with-setgid.html – Panther May 15 '18 at 14:08
  • I had achieved this by symbolic links –  May 15 '18 at 14:08

1 Answers1

-1

ACL can help:

# Create shared directory
sudo mkdir -p /media/Shared

# Give user1 and user2 rwX access to /media/Shared
sudo setfacl -m u:user1:rwX '/media/Shared'
sudo setfacl -m u:user2:rwX '/media/Shared'

# Make rwX access the default for new files and folders for both users
sudo setfacl -m default:u:user1:rwX '/media/Shared'
sudo setfacl -m default:u:user2:rwX '/media/Shared'

Change user1, user2 and /media/Shared to your needs.

pLumo
  • 26,947
  • Brilliant! Many thanks for your response. (Is it OK to thank people for their help here?) – spaceprobe May 16 '18 at 07:30
  • I'm glad my answer helped. Sure it's okay to thank others in comments. But usually you just thank people by up-voting or accepting answers ;-) – pLumo May 16 '18 at 07:37