0

Migrating from windows server (where this was unbelievably easy with virtual directories) to a linux server and have worked on this for weeks...

I want to share a users folder contents with all other users on the server.

share this folder: /home/user1/public_html/sharedfolder

to be available to user2, user3, etc.

symlinks seemed to be the answer, so I set up a symlink on user2 as so:

/home/user2/public_html/symlinkedfolder

I added user2 to group user1, set permissions on the folders, but it wouldn't work until I changed owner on the target folder to user2, which works for user2 (and user1, which surprised me) but won't work for user3, right?

When owner of target folder (and all files) is user1, error_log says "A symlink in the path has wrong destination owner"

Most of what I've done came from here: https://forums.cpanel.net/threads/share-directory-across-multiple-accounts.407431/ although I've read TONS of articles and tried lots of things before narrowing it down to an ownership issue (I think?)

So who should own the target of the symlink so it can be shared with all users?

Is there a complete (idiotproof) guide to accomplish this? Or a better method (something that works like windows server virtual directories would be awesome)? Please remember I'm new to Linux, and thanks for any suggestions.

KSechrist
  • 3
  • 2

1 Answers1

0

Compared to NTFS permissions, UNIX permissions are really limited: to user, group and everyone. However, you can always play with groups.

The files could be owned by the original user and by a group all the necessary users belongs to. This way, you could set permissions to 640 (or 750) to give full permissions to the user and read-only permissions to the group, without giving any to the rest.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
  • "The files could be owned by the original user and by a group all the necessary users belongs to" - I think I understand this - I put user2 in group user1, made sure all folders in the path had read and execute permissions for user1 group, and all files had read permission for user1 group. Obviously I'm missing something. "you can always play with groups" - you mean change the target folder group to something other than user1 or user2? I wouldn't know which groups to try - I see a bunch of groups other than my users but I'm still learning what they are. Considered trying nobody (apache?) – KSechrist Dec 25 '18 at 16:30
  • It's possible to add user2 to group user1, but that would give group permissions to every folder with the same group. Therefore, it's also possible to add a completely new group and add both user1 and user2 to it. – Esa Jokinen Dec 25 '18 at 16:44
  • Thank you Esa. "It's possible to add user2 to group user1, but that would give group permissions to every folder with the same group." - I did this but it doesn't seem to work. Access to everything else is ok because the entire server and all of the websites are mine. I'm just setting up websites under different accounts so I can give limited access to a web designer. FWIW I changed the symlink target's group to "nobody" and it seems to be working so far... except for php includes but that beast can be slayed another day. – KSechrist Dec 25 '18 at 17:10