-->
Previous Table of Contents Next


Again, what you type is not displayed on the screen. If your two password entries match, you see the following:


Password changed.

darkstar:~#

The password is now changed in the system’s configuration files. The change is effective immediately, and your old password is discarded.

If the two password entries you typed do not match completely (remember, case is important), Linux gives you a message similar to this one:


You misspelled it. Password not changed.

and changes are not made to the password. You need to start over with the passwd command from the beginning.


Tip:  
If you want to leave a program right away and return to the shell prompt, try Ctrl+C (hold the Ctrl key and press C; this is sometimes written as ^C). This usually terminates whatever program you’re in (usually without ill effects) and redisplays the shell prompt. For example, if you’re starting to change your password and haven’t thought of a good one, pressing Ctrl+C when Linux is asking for your new password terminates the routine and your old password is kept.

Creating a New Login

Now that you have assigned a password for the root account, the next step is to create a login with which you can safely explore the Linux system and try out some of the basic commands covered in the following chapters. Some Linux systems ask you to create a user account when you are installing the system, but most don’t. Even if you did create a user login during installation, you’ll probably want to add more for friends, family, or for you to use for other purposes.

Linux has a utility called adduser which simplifies and automates the task of adding a new user to the system. (This isn’t how they did it in the good old days. You should be glad—in the past, files had to be manually edited to add users and all their associated information, a tedious and error-prone process.)

To create a user, at the shell prompt type the command adduser:


darkstar:~# adduser

Adding a new user. The username should be not exceed 8 characters

in length, or you many run into problems later.



Enter login name for new account (^C to quit):

The prompts on your system may be slightly different, but they all approach the task of adding a user login the same way. Some Linux versions have full-screen utilities for the same task or make a utility available under a graphical windowing system that is a lot more attractive, but the bottom line is that the same information is required and must be entered by you.

Login names are used by all valid system users. You can create a login for yourself that you will use permanently, or you can create a temporary login for exploring the system and remove it later. Unlike some multiuser systems such as Windows NT, you can create and delete logins as often as you want, even reusing the same login name over and over again.

The key to every account is the login name. Login names can be made of any character or number string you want, although in general you should limit the length of the name to eight characters (which allows portability over networks and the Internet). Typically, login names bear a resemblance to the user’s real name, so that Joe Smith’s login name may be joe, jsmith, or joes. It’s a good idea to keep a consistent naming principle, especially if you are going to have several users on your system (you’ll be surprised how many friends want accounts on your Linux system!).

With some versions of Linux, you have to specify the login name that you’re trying to create on the same line as adduser:


adduser joes

If your system requires this, you’ll see an error message when you try to use the adduser command by itself.

At the adduser prompt, enter the login name that you want to create. It is advisable to use all lowercase letters to avoid confusion. Do not exceed the eight-character limit at this point. (Although a mixed case login can be useful for confusing people trying to hack into your system, it causes problems when your system tries to talk to others over a network.)

For our sample user account in this chapter, let’s create the user fido. (After all, as the joke goes, “On the Internet, no one knows if you’re a dog!”) Of course, you can substitute your choice on the screen in place of fido (unless you really like our login name).


Enter login name for new account (^C to quit): fido

Editing information for new user [fido]

Full Name:

After entering the login name, a status message from the adduser utility usually appears, followed by a set of questions about the new user and the type of environment to present the account with when the user logs in. (The exact order of questions may be different, but usually most of the same information is requested.)

In the example previously shown, the adduser routine is waiting for the user’s real name. At this prompt, type the full name of the user. Uppercase, lowercase, mixed case, and spaces are fine. This information is not mandatory but is used by the system for some other tasks. Other users can also identify you with this name when you are on a network.


Full Name: Fido Dog

GID [100]:

The system is waiting for you to provide a GID or Group ID, which is discussed in more detail in Chapter 35, “Users and Logins.” The last part of the prompt, [100], means that it’s suggesting a GID of 100. This is the default choice and is good for most systems unless you are part of a larger network which has a naming policy in effect. For most users, the default is a great way to start and you can always change it later if you need to.


Tip:  
In this adduser utility and many other Linux programs, default choices are presented in square brackets. Simply press the Enter key to accept the default, or type the new value if you don’t want to accept the default value.

Sometimes (as you will see later in the adduser utility) you are given two choices—usually y for yes and n for no—separated by a / or | character. The uppercase letter is the default choice which you can select by pressing Enter. The other choice must be typed explicitly. In the following examples, yes is always the default choice: [Y/n], [Y|n], [Yn].



Previous Table of Contents Next