170 The Virtualization Cookbook for Red Hat Enterprise Linux 5.2
On the next window, set the Server value to point to the LDAP server. In this example, it is
ldap://9.12.5.32/. Set the Base DN to your suffix value. In this example it is
dc=itso,dc=ibm,dc=com. Press OK.
Your LDAP client should now be pointing to the LDAP server. Test it using the id ldapuser1
command:
# id ldapuser1
uid=500(ldapuser1) gid=500(ldapuser1) groups=500(ldapuser1)
context=root:system_r:unconfined_t:s0-s0:c0.c1023
Authentication should also allow LDAP. Test this by starting another SSH session to the LDAP
server and logging in as ldapuser1:
login as: ldapuser1
When you get an SSH session as ldapuser1, this shows that authentication is working.
12.2.6 Adding new user accounts
There are different front-ends to LDAP administration, however, there is no industry standard.
A detailed discussion about front-end tools is beyond the scope of this book. However, it is
useful to be able to add users using line commands. This section describes how to create a
new LDIF file and add a new user.
Go back to the directory /usr/share/openldap/ and view the LDIF file you created earlier,
accounts.ldif using the less command. Search for the user ldapuser1 using the /
subcommand:
# cd /usr/share/openldap/migration
# less accounts.ldif
/ldapuser1
Before:
dn: uid=ldapuser1,ou=People,dc=itso,dc=ibm,dc=com
uid: ldapuser1
cn: ldapuser1
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
shadowLastChange: 13515
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 500
gidNumber: 500
homeDirectory: /home/ldapuser1
Copy and paste the lines for that user to a new file ldapuser.ldif. Change the name
ldapuser1 to the desired new name (ldapuser2, in this example). Also increment the
uidNumber field (to 501, in this example)
# vi ldapuser.ldif
After:
dn: uid=ldapuser2,ou=People,dc=itso,dc=ibm,dc=com
uid: ldapuser2
cn: ldapuser2
Komentarze do niniejszej Instrukcji