Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ypldap Client - Automatic Home Directory Creation

68 views
Skip to first unread message

Gary

unread,
Dec 9, 2011, 6:13:22 PM12/9/11
to
I've successfully configured OpenBSD to allow users to authenticate
against Novell eDirectory via ypldap. It works great, *however*, the
creation of the user's home directories is still manual. Is there a way
to automatically create a user's home directory upon the initial
successful LDAP authentication?




(Below is our configuration in case it helps someone else attempting
something similar:)

1. Install OpenBSD.
2. Log in as root.
3. Set the PKG_PATH variable to your nearest FTP location.
4. Install the "login_ldap" package: "pkg_add login_ldap".
5. Add the following lines to "/etc/login.conf":

ldap:\
:auth=-ldap:\
:x-ldap-server=<THE IP OF YOUR LDAP SERVER>:\ # <-- EG: "192.168.0.1"
:x-ldap-uscope=sub:\
:x-ldap-basedn=<THE BASE OF YOUR SEARCH>:\ # <-- EG: "o=co"
:x-ldap-filter=<THE CRITERA OF THE RECORDS TO BE RETURNED>:\ # <-- EG:
"(&(ObjectClass=Person)(cn=%u))"
:tc=default:

6. Test ldap authentication: /usr/libexec/auth/login_-ldap -d -s login
USERNAME ldap
7. Edit the "/etc/ypldap.conf" file as follows:

domain "<YOUR DESIRED YP DOMAIN>"
interval 60
provide map "passwd.byname"
provide map "passwd.byuid"
provide map "group.byname"
provide map "group.bygid"
directory "10.10.80.26" {
basedn "<THE BASE OF YOUR SEARCH>" # <-- EG: "o=co"
passwd filter "<THE CRITERIA FOR THE NAME RECORDS>" # <-- EG:
"(objectClass=Person)"
fixed attribute passwd "*"
attribute uid maps to "uidNumber" # <-- Be sure to add this attribute
to the user in eDirectory. EG: "2000" or the employee number.
attribute gid maps to "gidNumber" # <-- Ditto.
attribute gecos maps to "cn"
attribute home maps to "homeDirectory" # <-- Be sure to add this
attribute to the user in eDirectory. EG: "/home/myname"
fixed attribute shell "/bin/ksh"
fixed attribute change "0"
fixed attribute expire "0"
fixed attribute class "ldap" # <-- Important, this tells ypldap to use
login_ldap, as configured in step 5.
group filter "<THE CRITERIA FOR THE GROUP RECORDS>" # <-- EG:
"(objectClass=Person)"
attribute groupname maps to "cn"
fixed attribute grouppasswd "*"
attribute groupgid maps to "gidNumber # <-- Ditto above.
list groupmembers maps to "memberUid" # <-- Ditto above.
}

8. Set the yp domainname: "domainname <YOUR DESIRED YP DOMAIN>"
9. Update configured yp domainname: 'echo "<YOUR DESIRED YP DOMAIN>" >
/etc/defaultdomain
10. Add the following stub to the last line of /etc/passwd with vipw:

+:::::::::/bin/ksh

11. Add the following stub to the last line of /etc/group:

+:::

12. Start ypldap and ypbind.
13. Authenticate.

Gary

unread,
Dec 13, 2011, 11:17:02 AM12/13/11
to
On 12/09/2011 4:13 PM, Gary wrote:
> I've successfully configured OpenBSD to allow users to authenticate
> against Novell eDirectory via ypldap. It works great, *however*, the
> creation of the user's home directories is still manual. Is there a way
> to automatically create a user's home directory upon the initial
> successful LDAP authentication?
>

As an update: it appears that the standard way of doing this in most
other systems is using the pam_mkhomedir.so module. I have not yet
found an equivalent utility for OpenBSD's yp system...

Joachim Schipper

unread,
Dec 21, 2011, 3:29:28 AM12/21/11
to
If you haven't tried asking your question on misc@ yet, do so. (I'm
sorry, I'm terribly behind on my mailing lists...)

Joachim
0 new messages