| UNIX Tutorial | 2. Logging in, logging out | ||||||||
|
Commands covered in this section: whoami, passwd, logout Since UNIX supports multiple users at one time, you must identify yourself to the system before you can begin using it. This process is called logging in. When you connect to a computer running UNIX (often called a UNIX host), you are asked to provide two pieces of information in order to log in: your login name, which is your identity on the system, and your password, which proves (or at least improves the likelihood) that you are indeed who you say you are. Throughout the tutorial, we will assume your login name is "natasha" and you are logging into a UNIX host called "peabody." Exercise 2.1
Connect to a UNIX host on which you have an account (this can be
accomplished by using the telnet or ssh program running
on a PC or a Mac, for example). Log in by supplying your login name
and password when prompted (your password will not be displayed when
you type it), as shown below:
When you log in, the system will print several lines of information on
the screen. After you've logged in a few times and the novelty has worn
off, you may be tempted to ignore this and start using the system.
Don't! There are several important pieces of information
displayed here. The first line you see after typing your password tells
you when you last logged in. If you see something like:
Last login: Fri Feb 14 03:52:12 from evil.hackers-r-us.organd you've never heard of a machine called "evil," you might begin to suspect that your account has been compromised... The next several lines are from a file called motd (message of the day). This is where the system administrator places important announcements about the system. If new electronic mail addressed to you has arrived, you will see a message informing you of this. You may also be prompted for a terminal type. If the system suggests one for you (as in "vt100" in our example), accept it by pressing the RETURN key; otherwise, you must supply the correct terminal type yourself (ask your system administrator for assistance if you are not sure). Finally, you will see the shell prompt ("%" in our example). You are now ready to begin issuing commands to the UNIX system! In order to ease ourselves into this business, let's begin with a very simple command, whoami. This command requires no options or arguments, and has the highly desirable side effect of reassuring the user by confirming his or her identity. Exercise 2.2
Enter the whoami command at the shell prompt and see
what happens.
That's it -- all this command does is print the login name of the
current user. Congratulations, you've just had your first taste of
the power of UNIX!
Now before you get carried away with all that power, let's talk a bit more about passwords. Remember that UNIX uses your password to verify that it's you who is entering the system under your login name and not someone else. Therefore, only you should know your password. In order to be effective, the password must be extremely difficult for someone else to guess. Here are some simple guidelines: Don't:
Table 2.1 Once an account is broken into, it can be used to stage further attacks on the same host or other hosts on the Internet. As a trusted member of a community of UNIX users, you have a civic duty to select good passwords and change them on a regular basis -- anything less would be uncivilized! In fact, right now is a good time to start. You use the passwd command to change your password. Exercise 2.3
Enter the passwd command at the shell prompt. You
will be prompted to enter your old password (to confirm that it's
really you), and then your new password (twice, to ensure that you
didn't make a typing error). In all cases, passwords are not
displayed on the screen as you type them. Depending on which
version of UNIX you are using, the wording in the prompts may
vary slightly from that shown here.
Once you've completed your work, you can end your UNIX session by
logging out. This is accomplished via the logout
command.
Exercise 2.4
Enter the logout command at the shell prompt.
Of course, you'll have to log back in to continue with the tutorial.
Now that you know how to log in and log out, you have the option to
stop working on the tutorial at any point and later resume where you
left off. In the next section of the tutorial, we will begin to
explore the UNIX environment in more detail.
|
|||||||||
|
< previous | table of contents | next > |
|||||||||