I'm trying to create a jailed user for limited SSH access on my Mac. I have been, for the most part, following the directions in this Ubuntu StackExchange answer.

However, I'm getting stuck:

# First, added `root` group via System Preferences > Users & Groups
# (`/sbin/groupadd` is not present on macOS)

$ sudo chown root:root /Users/jail
$ ls -ld /Users/jail
drwxr-xr-x+ 13 root  root  442 Jan 12 15:21 /Users/jail
$ sudo /usr/local/Cellar/jailkit/2.19/sbin/jk_init -v /Users/jail basicshell
ERROR: /Users/jail is not owned by root:root!

ERROR: jail directory /Users/jail is not safe

This mailing list message looks relevant, but I'm not 100% sure (basically, jailkit wants the entire directory tree leading up to the chroot jail to be owned by root:root... but / is owned by root:wheel by default on a Mac).

Any insight would be greatly appreciated.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.