The preferred way, in macOS, to share files is to create a directory in /Users/Shared
and place the files in that directory. And, of course, give that directory and the enclosed files (in this case an encrypted image) the permissions you require to give the two users r/w access.
Whilst you can give user2 access to files in user1's home folder, this can get messy as default permissions do not, for example, allow world read of "Documents" folder. Further, these folders are subject to special privacy protection rules in addition to regular file permissions. So do use /Users/Shared
.
You also need to consider the permissions of file and folders inside the encrypted image. Since the two users are the only ones with access to the image and, presumably, know the encryption password, the easiest way to manage these permissions is to ignore permissions on the volume.
All of these changes can be made in Finder's Get Info (Command-I) windows. But if you really want or need to set POSIX permissions at the command line, have at it.
The GUI way to create and manage groups is to use "Users & Groups" setting under "System Preferences".
Create the group using the + at bottom left (after unlocking with your administrator password). Give the group a name and add members.
Two points:
- Ignore what is in
/etc/group
, except to avoid duplicating any name with your new group.
- Do not use standard Linux commands to manage groups and users.
The new group can then be used with folder and file permission using Finder's Get Info (Command-I).