📄 ch06.htm
字号:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
-->
<H1></H1>
<UL>
<LI><A HREF="#Heading1">- 6 -</A>
<UL>
<LI><A HREF="#Heading2">Getting Started</A>
<UL>
<LI><A HREF="#Heading3">Starting (and Stopping!) Your Linux System</A>
<LI><A HREF="#Heading4">WARNING</A>
<UL>
<LI><A HREF="#Heading5">Whats This About Logging In?</A>
</UL>
<LI><A HREF="#Heading6">NOTE</A>
<LI><A HREF="#Heading7">NOTE</A>
<LI><A HREF="#Heading8">NOTE</A>
<UL>
<LI><A HREF="#Heading9">Why You Shouldnt Use the root Login</A>
</UL>
<LI><A HREF="#Heading10">WARNING</A>
<LI><A HREF="#Heading11">NOTE</A>
<UL>
<LI><A HREF="#Heading12">Your First Login</A>
</UL>
<LI><A HREF="#Heading13">NOTE</A>
<LI><A HREF="#Heading14">Passwords</A>
<LI><A HREF="#Heading15">NOTE</A>
<LI><A HREF="#Heading16">WARNING</A>
<LI><A HREF="#Heading17">WARNING</A>
<LI><A HREF="#Heading18">TIP</A>
<LI><A HREF="#Heading19">Creating a New Login</A>
<LI><A HREF="#Heading20">TIP</A>
<LI><A HREF="#Heading21">NOTE</A>
<LI><A HREF="#Heading22">Logging Out</A>
<LI><A HREF="#Heading23">Trying Out Your New Login</A>
<LI><A HREF="#Heading24">NOTE</A>
<UL>
<LI><A HREF="#Heading25">Linux Error Messages</A>
<LI><A HREF="#Heading26">Search Paths</A>
</UL>
<LI><A HREF="#Heading27">Virtual Terminals</A>
<LI><A HREF="#Heading28">Commands and Programs</A>
<LI><A HREF="#Heading29">Summary</A>
</UL>
</UL>
</UL>
<P>
<HR SIZE="4">
<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 6 -</FONT></H2>
<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Getting Started</FONT></H2>
<P><I>by Ed Treijs</I></P>
<P>IN THIS CHAPTER</P>
<UL>
<LI>Starting (and Stopping!) Your Linux System
<P>
<LI>Passwords
<P>
<LI>Creating a New Login
<P>
<LI>Logging Out
<P>
<LI>Trying Out Your New Login
<P>
<LI>Virtual Terminals
<P>
<LI>Commands and Programs
</UL>
<P><BR>
Congratulations! Now that you have successfully installed Linux, you can start using
it. In this chapter we will look at the steps you need to take to begin working with
Linux, including the following:
<UL>
<LI>Starting and stopping Linux
<P>
<LI>Logging in and out
<P>
<LI>Creating a new user with <TT>adduser</TT>
<P>
<LI>Changing your password
<P>
<LI>Using virtual terminals
<P>
<LI>Displaying system users with <TT>who</TT>
</UL>
<H3 ALIGN="CENTER"><A NAME="Heading3<FONT COLOR="#000077">Starting (and Stopping!)
Your Linux System</FONT></H3>
<P>Depending on the setup you chose during Linux installation and configuration,
either Linux starts automatically when you power on your computer, or it requires
you to type something (such as <TT>Linux</TT>) to specify that you want to boot Linux.</P>
<P>As your Linux system starts up, you see quite a few Linux initialization messages
scroll through your screen. When Linux has completed its startup, you should see
the following prompt:</P>
<PRE><FONT COLOR="#0066FF">Welcome to Linux 2.0.0.
darkstar login:
</FONT></PRE>
<DL>
<DT><FONT COLOR="#0066FF"></FONT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading4<FONT COLOR="#000077"><B>WARNING:</B> </FONT>A Linux system
must always be shut down properly. Improper shutdown, such as simply turning off
your system, can cause serious damage to your Linux system! When you are finished
using your Linux system, you must shut it down properly, as described in the next
section. If you start to boot Linux, and then change your mind, you should let the
system start up fully and then follow the shutdown procedure.
<HR>
</DL>
<P>Because you know how to start Linux, it's even more important to know how to shut
it down properly. Like many UNIX systems, if Linux is not powered down properly,
damage to files can result. The easiest way to ensure a proper shutdown is to press
the Ctrl, Alt, and Delete keys simultaneously. (This is the famous Ctrl-Alt-Delete
"three-finger salute" used in DOS.)</P>
<P>Pressing Ctrl-Alt-Delete causes a number of advisory messages and Linux shutdown
messages to be displayed. You must wait until the Linux shutdown procedure has finished,
at which point your monitor shows the initial "power-on" screen, before
turning your computer off.
<H4 ALIGN="CENTER"><A NAME="Heading5<FONT COLOR="#000077">Whats This About
Logging In?</FONT></H4>
<P>Linux waits for a login. A login is simply the name that you supply to Linux to
identify yourself to the operating system. Linux keeps track of which names are permitted
to log in or access the system, and only allows valid users to have access.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading6<FONT COLOR="#000077"><B>NOTE: </B></FONT>If you supplied
a name to your system when installing Linux, the system name is used at the prompt.
In the login shown earlier, the system has been called <TT>darkstar</TT>. The system
name enables you to identify your machine to others when using networks or modem
connections. Don't worry if you didn't name your system yet, because you can change
the system's name at any time.
<HR>
</DL>
<P>Every login name on the system is unique. Normally, a password is assigned to
each login, too. This secret password is like the identification number you use with
your bank card to prove that you really are who you say you are. Also, the things
you can do with your login--the login's privileges--are controlled by Linux; different
logins have different levels of privileges.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading7<FONT COLOR="#000077"><B>NOTE: </B></FONT>Usually, login names
reflect a person's real name. Although you can't have two identically named logins
on your system, you can easily create logins for users with the same (real) name
by having one or two characters different. So, for example, the login names <TT>suej</TT>
and <TT>suek</TT> are treated by Linux as completely separate logins. Conversely,
there is no reason that one human being (for instance, yourself) can't have two,
three, or a dozen login names. In fact, because you will be the system administrator
of your Linux system, you will have one or more administrative logins, and one or
more regular user logins.
<HR>
</DL>
<P>At the login prompt, try typing your name, your dog's name, or any other random
name that occurs to you. None of these are valid logins (at least not yet). The system
asks you for a password; it won't matter what you type, so just press Enter or type
a random string of characters. Because the logins are not valid on the system, Linux
won't let you in. It displays the message <TT>Login incorrect</TT> to tell you that
either the name or the password you entered is not valid.</P>
<P>The only valid login on your Linux system after installation is the most powerful
and dangerous login Linux offers: <TT>root</TT>. In the section "Creating a
New Login," later in this chapter, we will create a safe login for you to use.
This login can have your name, your dog's name, or whatever else you choose.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading8<FONT COLOR="#000077"><B>NOTE:</B> </FONT>The login prompt
is actually produced by a program called <TT>login</TT> whose only task is to accept
your user ID and password, verify it, and then display a message preventing your
access or letting you through to the next program that starts your user session.
<HR>
</DL>
<H4 ALIGN="CENTER"><A NAME="Heading9<FONT COLOR="#000077">Why You Shouldnt
Use the root Login</FONT></H4>
<P>You will have to use the <TT>root</TT> login from time to time. Some things simply
cannot be done on the Linux system without logging in as <TT>root</TT>. You should
not, however, use the <TT>root</TT> login as your regular login. This is especially
true if you are exploring the system, poking around, and trying out new commands
that may not do what you thought they would!</P>
<P>Linux, as you already know, is a multiuser, multitasking operating system. Multiuser
means that several people can be using Linux at the same time (of course, you have
to add some additional terminals to your system, or it will get very crowded around
the keyboard). Multitasking means that Linux can do more than one thing at a time.
For example, you can spell-check a document while downloading information from some
remote system. (Multiuser implies multitasking, because all users must be able to
do their own work at the same time.) Linux, therefore, is very good at juggling all
these tasks, keeping them from interfering with each other, and providing safeguards
so that you cannot damage the system or another user's work.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading10<FONT COLOR="#000077"><B>WARNING:</B> </FONT>The <TT>root</TT>
login does not restrict you in any way. With one simple command, issued either on
purpose or by accident, you can destroy your entire Linux installation. For this
reason, use the <TT>root</TT> login only when necessary. Avoid experimenting with
commands when you do log in as <TT>root</TT>.
<HR>
</DL>
<P>When you log in as <TT>root</TT>, you become the system. The <TT>root</TT> login
is also sometimes called the superuser login, and with good reason. To use an analogy,
instead of being a passenger on an airplane, you suddenly have all the privileges
of the flight crew, the mechanics, and the cabin crew. "Hmm, what does this
do?" becomes an extremely dangerous phrase when logged in as <TT>root</TT>.</P>
<P>One of the oldest stories in UNIX lore tells of new users who log in as <TT>root</TT>
and, in 10 keystrokes, destroy their system completely and irrevocably. But if you're
careful to follow the steps given here, and stop and take a moment to think about
the commands you are giving, none of the "How many new users does it take to
nuke a system?" jokes will apply to you!
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading11<FONT COLOR="#000077"><B>NOTE: </B></FONT>System administrator
is another term you will see often. A system administrator is the actual person who
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -