Allow user to SSH to my Mac, but sandbox the account I would like to create an SSH account on my Mac to allow some friends to test code on my machine from the command line.

However, I want to sandbox them, so that the only folders/files they can see are those owned by them within their user folder. All other user folders, the application folder, etc, would be hidden. Ideally external volumes would also be hidden.

Is this possible to do with a standard user account? (The other accounts on the system are admin accounts) Is the guest account a better choice?
Secure Shell (ssh) Jail

The phrase you need to search for is jail ssh user.

See the questions and articles linked below for a range of approaches; being Unix-y, these approaches should also work on macOS:


Restrict SSH User Access to Certain Directory Using Chrooted Jail
Simple &amp; easy way to jail users
Jail user in SFTP + SSH