Use an LDIF File to Add a User

Do the following:

1. With a text editor, create a file named tux.ldif in the directory /tmp with the following content.:

dn:uid=tux,ou=people,dc=digitalairlines,dc=com objectClass: top objectClass: posixAccount objectClass: shadowAccount objectClass: inetOrgPerson cn: Tux Penguin gidNumber: 100

givenName: Tux homeDi rectory: /home/tux loginShell: /bin/bash shadowInactive: -1

shadowLastChange: 12609

shadowMax: 99999

shadowMin: 0

shadowWarning: 7

sn: Penguin uid: tux userPas sword: {crypt}GpyJ3/OQgLxZE uidNumber: 1010

You can also copy the LDIF file tux.ldif from the directory /exercises/section_3 from your 3038 Course CD to the directory /tmp.

2. Save the file and close the text editor.

3. From a terminal window (as root), add the user tux by entering the following (all on one line):

"cn=Administrator,dc=digitalairlines,dc=com" -W -f /tmp/tux.ldif

4. When prompted for a password, enter novell.

If you are unsuccessful at authenticating as Administrator, try closing the terminal window and opening a new terminal window. Repeat steps 3 and 4.

You do not have to be root to enter the ldapadd command; however, you need to be root for the commands that follow.

5. Create the home directory for the user tux by entering the following:

6. Adjust the file system permissions by entering the following commands:

chown -R tux:users /home/tux/

7. Log out as root by entering exit.

8. Switch to the user tux by entering the following: su - tux

9. Log in to the tux user account by entering a password of Novell.

10. Log out as tux by pressing Ctrl+D.

11. Close the terminal window.

(End of Exercise)

Objective 3

Figure 3-7

Was this article helpful?

0 0

Post a comment