Let’s assume that your installation went completely smoothly, and you are facing the following prompt on your screen:
Some Linux users are not so lucky; they have to perform some heavy tinkering when the system is still in a raw state or in single-user mode. But for now, we’ll talk about logging into a functioning Linux system.
Logging in, of course, distinguishes one user from another. It lets several people work on the same system at once and makes sure that you are the only person to have access to your files.
You may have installed Linux at home and are thinking right now, “Big deal. No one else shares this system with me, and I’d just as soon not have to log in.” But logging in under your personal account also provides a certain degree of protection: your account won’t have the ability to destroy or remove important system files. The system administration account (covered in the next chapter) is used for such touchy matters.
If you connect your computer to the Internet, even via a modem, make sure you set nontrivial passwords on all your accounts. Use punctuation and strings that don’t represent real words or names. Although Unix systems are not as susceptible to random brute-force attacks from the outside world as Windows systems are (according to some sources, it takes about 20 minutes from connecting a Windows box to the Internet until that computer is attacked, whereas it takes about 40 minutes to download the security fixes from Microsoft), you certainly do not want anybody to snoop around in your files.
Note that some distributions install a so-called graphical login
manager right away, so you might not be greeted by the somewhat arcane
login: prompt in white letters on
black background, but with a fancy graphical login screen, possibly
even presenting you with the user accounts available on your system
(maybe even with a little picture for each user) as well as different
modes to log into. The basic login procedure is the same as described
here, however: you still type your username and password.
You were probably asked to set up a login account for yourself
when you installed Linux. If you have such an account, type the name
you chose at the
prompt. If you don’t have an account yet, type
root because that account is certain to
exist. Some distributions may also set up an account called
install or some other name for fooling around
when you first install the system.
After you choose your account, you see:
and you need to enter the correct password. The terminal turns off the normal echoing of characters you enter for this operation so that people looking at the screen cannot read your password. If the prompt does not appear, you should add a password to protect yourself from other people’s tampering; we’ll go into this later.
By the way, both the name and the password are case-sensitive.
Make sure the Caps Lock key is not set because typing
ROOT instead of
root will not work.
When you have successfully logged in, you will see a prompt. If you’re root, this may be a simple:
For other users, the prompt is usually a dollar sign (
$). The prompt may also contain the name you
assigned to your system or the directory you’re in currently. Whatever
appears here, you are now ready to enter commands. We say that you are
at the “shell level” here and that the prompt you see is the “shell
prompt.” This is because you are running a program called the
shell that handles your commands. Right now we
can ignore the shell, but later in this chapter we’ll find that it
does a number of useful things for us.
As we show commands in this chapter, we’ll show the prompt
$. So if you see:
it means that the shell prints
$ and that
pwd is what you’re supposed to enter.