Wednesday, May 21, 2008

Add Users to the LDAP Directory

In this exercise, you add a user with the following information to your LDAP directory:

Information Value
Login kbailey
Name Kate Bailey
UID 1010
GID 100
Home directory /home/kbailey
Login shell /bin/bash

1. There should be some entries in the LDAP directory created by YaST. To see the content of your LDAP directory enter ldapsearch -x
2. Create an LDIF file by entering vi example.ldif
3. To create a Posix accout for a new user kbailey, add the following lines:
dn: uid=kbailey,ou=people,dc=digitalairlines,dc=com
objectClass: posixAccount
objectClass: shadowAccount
objectClass: inetOrgPerson
uid: kbailey
uidNumber: 1010
gidNumber: 100
cn: Kate Bailey
givenName: Kate
sn: Bailey
homeDirectory: /home/kbailey
loginShell: /bin/bash
shadowMax: 99999
shadowWarning: 7
shadowInactive: -1
shadowMin: 0
shadowLastChange: 12609
You also can copy the file exercises/section_3/kbailey.ldif from the Course DVD.
4. Save the file and exit the text editor by entering :wq.
5. Add the LDIF file to your LDAP database by entering
ldapadd -x -D "cn=Administrator,dc=digitalairlines,dc=com" -W -f kbailey.ldif
6. Enter the password for the LDAP administrator (novell).
7. To see the content of your LDAP directory, enter
ldapsearch -x "uid=kbailey"

No comments: