|
NAMEldap2pw - Synchronize local user database with LDAP directorySYNOPSISldap2pw [-npv] [-b base] [-d domain] [-h host] [-P page size] [-s servers] [-u user[@domain]] [-G group filter] [-U user filter] [overrides]DESCRIPTIONThe ldap2pw utility synchronizes the local user database with an LDAP directory. It is intended for systems where NSS modules cannot be used or access to the LDAP server is intermittent.The ldap2pw utility starts by searching the LDAP directory for user objects that have a UIDNumber attribute and group objects that have a GIDNumber attribute. Next, it reads the local user and group database. The users and groups obtained from both the LDAP directory and the local database are filtered according to the following criteria:
Finally, the two lists are compared and the local database is updated as follows:
The following options are available:
Any subsequent arguments are taken as key-value pairs which override the user attributes found in LDAP. Currently, only the home directory (home) and the login shell (shell) can be overridden. IMPLEMENTATION NOTESThe ldap2pw utility was designed for use with Microsoft Active Directory servers, and assumes that the server supports and requires GSSAPI authentication and that a valid Kerberos ticket is available.EXAMPLESSynchronize the local user and group database on a firewall that uses authpf(8):% sudo env KRB5CCNAME=/var/db/ro_user.cc ldap2pw -pv -u ro_user home=/var/empty shell=/usr/sbin/authpf # host: client.example.com # domain: example.com # user: ro_user@example.com # looking up SRV for _ldap._tcp.example.com # servers: dc01.example.com dc02.example.com # base: DC=example,DC=com # Attempting to connect to dc01.example.com # Retrieving users from LDAP # Looking for (&(objectclass=user)(uidnumber=*)) in DC=example,DC=com # last page (3) # Retrieving groups from LDAP # Looking for (&(objectclass=group)(gidnumber=*)) in DC=example,DC=com # last page (4) # Resolving group membership # bob member user bob # des member user des # kenneth member user kenneth # staff member user bob # staff member user des # staff member user kenneth # Retrieving users from local database # Retrieving groups from local database # group kenneth missing /usr/sbin/pw groupadd kenneth -g 1003 # user kenneth missing /usr/sbin/pw useradd kenneth -u 1003 -g 1003 -c 'Kenneth 36' -d /var/empty -s /usr/sbin/authpf # group kenneth mismatch /usr/sbin/pw groupmod kenneth -g 1003 -M kenneth # group staff mismatch /usr/sbin/pw groupmod staff -g 1000 -M bob,des,kenneth # not deleting group guests SEE ALSOkinit(1), pw(8)AUTHORThe ldap2pw utility was written by Dag-Erling Smørgrav <d.e.smorgrav@usit.uio.no> for the University of Oslo.
Visit the GSP FreeBSD Man Page Interface. |