I'd like to use SFTP/SSH for users (students and faculty) to manage their web content. The default home directory is "/Users//". I'd like to point them to something like "/Users//web" to block access to the other folders that are created in the home directory.

I want to use terminal in order to avoid manually changing the setting for > 400 users. Is this possible?

  • What OD software is configured? The typical slapd process for server?
    – bmike
    Commented May 1, 2013 at 17:08
  • I'm using Apple's Server app. Would that count as a SLAPD?
    – somehume
    Commented May 1, 2013 at 18:03
  • Yes - if you run sudo slapcat | more from terminal once you've ssh into the server it will dump the contents of the directory and you can see if you want to thin it out a bit.
    – bmike
    Commented May 1, 2013 at 18:07

1 Answer 1


Yes, it's certainly possible, but you'll need a bit of scripting knowledge to do it entirely. I wish I had a more elegant solution to edit things in place, but here's ham-fisted option if no one has a more surgical option.

I typically use slapcat to dump the current user details to a text file and then process is using perl or whatever other tool you want. Since it's one file, even TextEdit can do a search/replace. By putting the users in a group, you can specify that in slapcat.

At this point, I'd convert that text file into the import format that server app wants - see it's help guide - Server Help: Create a file to import users or groups (or click this after pasting it locally to your Mac help://bookmark='https://help.apple.com/serverapp/mac/2.2/help/index.html?localePath=English.lproj#apd41051F16-D4B7-464F-BD1C-0CBEDF7CA29A')

At this point you could delete the affected records and re-introduce them with the correct home directories.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .