-->
Previous Table of Contents Next


After the Group ID has been given, the adduser program wants even more information:


GID [100]:

Checking for an available UID after 100

First unused uid is 101

UID [101]:

The adduser utility does not echo your Group ID choice to the screen if you simply press Enter. This can be a little disconcerting if you’re not used to it, especially if you look back and try to figure out what you’ve done. If you don’t see anything, the default value is used. Most Linux commands don’t echo what you have done, so this is a good time to get used to it.

The adduser utility now asks for a User ID or UID. In this case, Linux suggests a default value of 101. Again, the default is fine in this case, so simply press Enter. You can pick any number that isn’t already in use, but there’s not much point in changing either the GID or UID unless you have specific organizational reasons to do so.


Note:  
The User ID is used by Linux whenever it is referring to something you have done. The operating system is designed to use a number rather than the full login name because it takes up less room and is easier to manipulate. The User ID is important and each login on the system has its own unique number. By convention, UIDs of less than 100 (500 on some versions) are special system UIDs; root’s UID is 0. Regular users get UIDs starting at 100 (or 500).


Note:  
A few versions of Linux, such as Caldera’s OpenLinux, don’t bother asking you any questions at all when you use the adduser command. The adduser routine just finds the next GID and UID and assumes default values for all the rest of the information, too. While this is fast and easy, it does make configuring a login with nonstandard characteristics a bit more difficult.

The adduser utility then shows two more prompts asking for the user’s home directory and the shell:


Home Directory [/home/fido]:

Shell [/bin/bash]:

Choose the default values for Home Directory and Shell. You’ll see more about directories in Chapter 9, “File and Directory Permissions,” and look at different shells in Chapter 11, “bash,” Chapter 12, “pdksh,” and Chapter 13, “tcsh.” The default values are suitable for most user IDs.

As a last step, the adduser program asks for a password for the new user. At the prompt, enter a suitable password. If you press Enter without typing anything else, the password is set to the same string as the login or a null password, depending on the version of Linux. These two approaches are not recommended, however, because they are easy to guess. Even a simple password is better than none.


Password [fido]:



Information for new user [fido]:

Home directory: [/home/fido] Shell: [/bin/bash]

uid: [501] gid: [100]



Is this correct? [y/N]:

The adduser program now verifies that you are happy with all the information you have entered. If you are, type y for yes, and press Enter. The default value (shown by the capital letter) is N for no. If you choose the default, you are telling the script that the information displayed is not correct, and you have to start the whole process over again.

When you answer y to the question Is this correct?, the adduser program creates the new user’s directory and adds the user information to the system configuration files. You may see the following information appear on the screen as the adduser utility does its work. When the utility has finished, you see the Linux shell prompt again:


Adding login [fido] and making directory [/home/fido]



Adding the files from the /etc/skel directory:

./.kermrc -> /home/fido/./.kermrc

./.less -> /home/fido/./.less

./.lessrc -> /home/fido/./.lessrc

./.term -> /home/fido/./.term

./.term/termrc -> /home/fido/./.term/termrc

darkstar:~#

We will look at how to remove unwanted users from your /etc/passwd file in Chapter 35, “Users and Logins.”

Logging Out

Now that you have created a new user, you can use it in the next couple of chapters to explore Linux. To finish with your session as root, log out of the system by typing logout:


darkstar:~# logout



Welcome to Linux 1.2.13

darkstar login:

You see the login prompt display again. At this point, you can log back in as root or as the new user you have just created.

Some systems allow you to log out with the Ctrl+D sequence. If the shell you are using supports Ctrl+D as a logout command, the login prompt reappears. Otherwise, you may see a message such as this:


Use “logout” to leave the shell.

If you have used other UNIX systems before, you may be used to using Ctrl+D to log out. The default shell used by Linux does not support Ctrl+D unless the key mappings are changed to allow it. Some versions of Linux also allow the logoff command to be used with most shells.


Previous Table of Contents Next