RSS feed

Re: Using the initial letter in the home directory

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: Using the initial letter in the home directory

Acording to manpage of nslcd.conf and "Attribute mapping expressions" and bash manpage "${parameter:offset:length}"
I think that following example should work:
map     passwd  homeDirectory   "/home/${sAMAccountName:0:1}/${sAMAccountName}"

I haven't tested it, so please try it and you will see.


On Tue, May 24, 2016 at 6:22 PM, Giovanni Mascellani <g.mascellani [at]> wrote:
Hi dear nss-pam-ldapd users and developers.

I am considering migrating to nss-pam-ldapd a network that at the moment
is using a custom modification by me of the old libnss-ldap (the
modification is to overcome the common mismatch between the Active
Directory server and the Linux clients).

Due to the number of users, I am keeping the home directories grouped in
different directories by the initial letter of the username. For
example, the home of the user foo would be /home/f/foo instead of
/home/foo. Is it possible to do this with the map directive in
nslcd.conf? At the moment I have in the configuration:

  map     passwd  homeDirectory   "/home/${sAMAccountName}"

and would like something like

  map     passwd  homeDirectory

If this possible?

Thanks for the help and have a nice day.

Giovanni Mascellani <g.mascellani [at]>
PhD Student - Scuola Normale Superiore, Pisa, Italy

To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe [at] or see

Jakub Jindra
To unsubscribe send an email to or see