NIS to LDAP example

From Brandonhutchinson.com

(Difference between revisions)
Jump to: navigation, search
(New page: In this example, I bind a Solaris 8 NIS client to a Solaris 10 DSEE 6.2 LDAP server and convert the following NIS maps to LDAP containers: * ''passwd'' * ''group'' * ''auto_master'' * Two...)
Line 6: Line 6:
* Two non-standard NIS automount maps--''auto_pra'' and ''auto_soft''
* Two non-standard NIS automount maps--''auto_pra'' and ''auto_soft''
-
== Save the NIS maps as text files ==
+
=== Save the NIS maps as text files ===
Save the NIS maps as text files before binding the client to the LDAP server. As soon as you use ''ldapclient'' and bind to an LDAP server, ''/etc/nsswitch.ldap'' is copied over ''/etc/nsswitch.conf'' and your NIS client is stopped.
Save the NIS maps as text files before binding the client to the LDAP server. As soon as you use ''ldapclient'' and bind to an LDAP server, ''/etc/nsswitch.ldap'' is copied over ''/etc/nsswitch.conf'' and your NIS client is stopped.
Line 18: Line 18:
$ '''ypcat -k auto_soft > /tmp/nis_auto_soft_map'''
$ '''ypcat -k auto_soft > /tmp/nis_auto_soft_map'''
-
== Bind the Solaris 8 NIS client to the LDAP domain ==
+
=== Bind the Solaris 8 NIS client to the LDAP domain ===
Example:
Example:
# '''ldapclient -P simple -d subdomain.example.com -D cn=proxyagent,ou=profile,dc=subdomain,dc=example,dc=com ''LDAP_server_IP'''''
# '''ldapclient -P simple -d subdomain.example.com -D cn=proxyagent,ou=profile,dc=subdomain,dc=example,dc=com ''LDAP_server_IP'''''
System successfully configured
System successfully configured
 +
 +
=== Create the LDAP containers ===
 +
 +
Perform these steps on the LDAP client.
 +
 +
==== passwd ====
 +
 +
# '''ldapaddent -a simple -p -D "cn=Directory Manager" -h ''LDAP_server_IP'' -f /tmp/nis_passwd_map passwd'''
 +
Enter password:
 +
382 entries added
 +
 +
==== group ====
 +
 +
# '''ldapaddent -a simple -D "cn=Directory Manager" -h ''LDAP_server_IP'' -f /tmp/nis_group_map group'''
 +
Enter password:
 +
29 entries added
 +
 +
==== auto_master ====
 +
 +
auto_master NIS map:
 +
/vol.soft auto_soft -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
 +
/vol.pra auto_pra -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
 +
 +
Corresponding auto_master LDAP map (e.g., ''/tmp/auto_master.ldif''):
 +
dn: automountkey=/vol.pra,automountMapName=auto_master,dc=subdomain,dc=example,dc=com
 +
automountInformation: auto_pra -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
 +
objectClass: top
 +
objectClass: automount
 +
automountKey: /vol.pra
 +
 +
dn: automountkey=/vol.soft,automountMapName=auto_master,dc=subdomain,dc=example,dc=com
 +
automountInformation: auto_soft -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
 +
objectClass: top
 +
objectClass: automount
 +
automountKey: /vol.soft
 +
 +
# '''ldapmodify -a -D "cn=Directory Manager" -h ''LDAP_server_IP'' -f /tmp/auto_master.ldif

Revision as of 21:20, 12 December 2007

In this example, I bind a Solaris 8 NIS client to a Solaris 10 DSEE 6.2 LDAP server and convert the following NIS maps to LDAP containers:

  • passwd
  • group
  • auto_master
  • Two non-standard NIS automount maps--auto_pra and auto_soft

Contents

Save the NIS maps as text files

Save the NIS maps as text files before binding the client to the LDAP server. As soon as you use ldapclient and bind to an LDAP server, /etc/nsswitch.ldap is copied over /etc/nsswitch.conf and your NIS client is stopped.

On the Solaris 8 NIS client:

$ ypcat passwd > /tmp/nis_passwd_map
$ ypcat group > /tmp/nis_group_map
$ ypcat -k auto_master > /tmp/nis_auto_master_map
$ ypcat -k auto_pra > /tmp/nis_auto_pra_map
$ ypcat -k auto_soft > /tmp/nis_auto_soft_map

Bind the Solaris 8 NIS client to the LDAP domain

Example:

# ldapclient -P simple -d subdomain.example.com -D cn=proxyagent,ou=profile,dc=subdomain,dc=example,dc=com LDAP_server_IP
System successfully configured

Create the LDAP containers

Perform these steps on the LDAP client.

passwd

# ldapaddent -a simple -p -D "cn=Directory Manager" -h LDAP_server_IP -f /tmp/nis_passwd_map passwd
Enter password:
382 entries added

group

# ldapaddent -a simple -D "cn=Directory Manager" -h LDAP_server_IP -f /tmp/nis_group_map group
Enter password:
29 entries added

auto_master

auto_master NIS map:

/vol.soft auto_soft             -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
/vol.pra auto_pra               -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp

Corresponding auto_master LDAP map (e.g., /tmp/auto_master.ldif):

dn: automountkey=/vol.pra,automountMapName=auto_master,dc=subdomain,dc=example,dc=com
automountInformation: auto_pra -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
objectClass: top
objectClass: automount
automountKey: /vol.pra
 
dn: automountkey=/vol.soft,automountMapName=auto_master,dc=subdomain,dc=example,dc=com
automountInformation: auto_soft -rw,intr,soft,timeo=7,retrans=9,noquota,vers=2,proto=udp
objectClass: top
objectClass: automount
automountKey: /vol.soft
# ldapmodify -a -D "cn=Directory Manager" -h LDAP_server_IP -f /tmp/auto_master.ldif
Personal tools