Sharing Files Between Users on FreeBSD

This article was published in October of 2021 and last updated February 10th, 2022.

My brother and I have been working on a project together recently and it became apparent that we could benefit from having a place to share some audio and video files with eachother. I have a FreeBSD server co-located at a local ISP and I thought “why not use that?”

Users and groups

I started out by making user accounts and home directories for both of us with pw:

pw useradd me -m
pw useradd him -m

Then I created a group that we could each be a member of and which could own the shared directory. I specified the group ID to be up out of the way of the groups that are automatically created for each user, but this was not strictly necessary. pw made it easy to also add both of us to the group at the same time.

pw groupadd ourgroup -g 10000 -M me,him

Directory

I thought I would like to put our shared folder at /g/ourgroup. hier(7) does not indicate a place set aside for files shared among members of a group. I think using /g for files shared among members of a group is (or at least was) a common practice, perhaps paralleling the once-upon-a-time placement of user home directories in /u. In any event, I created the directory and set the permissions:

mkdir -p /g/ourgroup
chgrp ourgroup /g/ourgroup
chmod g+w /g/ourgroup

Moving files

My brother and I both use Transmit 5 to move files around. I performed the same setup steps on each of our workstations.

I started out by going to the Keys tab of Preferences and creating a new key. I took the option to copy the new public key to the clipboard and appended it to ~/.ssh/authorized_keys on the server (using the root account to su to the respective user account first).

Next, I added an SFTP server in Transmit. I set the server title (or nickname), address, and user name. Instead of a password, I selected the new key I had just created. For convenience, I set the remote path to /g/ourgroup.

Back in Preferences, I found I could set “Windows open with” to have Transmit connect to and bring up the server in the right pane automatically when the program starts. I was also able to drag a couple of common locations on the server (like my home directory and the shared directory) into the locations bar on the server side of the window for easy access. We move some larger files around, so I found it handy to turn on the progress bar at the bottom of the window. That option was in the View menu.

We're now happily sharing our files back and forth, using old-school tech with a modern twist. I hope that you found this helpful. If this is the kind of thing you're into, you may enjoy my other articles. If you have any questions or comments, please drop me a line at the address below.

Aaron D. Parks
aparks@aftermath.net