📄 ch01_24.htm
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 1] 1.24 The Superuser (Root) </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly & Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly & Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:31:32Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch01_01.htm"TITLE="1. Introduction"><LINKREL="prev"HREF="ch01_23.htm"TITLE="1.23 File Access Permissions "><LINKREL="next"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_23.htm"TITLE="1.23 File Access Permissions "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 1.23 File Access Permissions "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 1<BR>Introduction</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.25 Access to Directories "BORDER="0"></A></TD></TR></TABLE> <HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-1034">1.24 The Superuser (Root) </A></H2><PCLASS="para">In general, a<SPANCLASS="link"><EMCLASS="emphasis">process</EM> (<ACLASS="linkend"HREF="ch38_01.htm#UPT-ART-4890"TITLE="What's in This Chapter ">38.1</A>)</SPAN>is a program that's running: a shell, the<EMCLASS="emphasis">ls</EM> command, the <EMCLASS="emphasis">vi</EM> editor, and so on.In order to<SPANCLASS="link">kill a process (<ACLASS="linkend"HREF="ch38_10.htm"TITLE="Destroying Processes with kill ">38.10</A>)</SPAN>,<SPANCLASS="link">change its priority (<ACLASS="linkend"HREF="ch39_09.htm"TITLE='Know When to Be "nice" to OTher Users...and WhenNot to'>39.9</A>)</SPAN>,ormanipulate it in any other way, you have to be the process' owner(i.e., the user who started it). In order to delete a job from a<SPANCLASS="link">print queue (<ACLASS="linkend"HREF="ch43_01.htm#UPT-ART-4960"TITLE="Introduction to Printing ">43.1</A>)</SPAN>,you must be the user who started it.</P><PCLASS="para">As you might guess, there needs to be a way to circumvent all of thissecurity. Someone has to be able to kill runaway programs, modify thesystem's files, and so on. Under UNIX, a special user known as<EMCLASS="emphasis">root</EM> (and commonly called the "superuser") is allowed to doanything.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-2257"></A><ACLASS="indexterm"NAME="AUTOID-2260"></A>On any system, the root user should always have a password.The system administrator should be very careful about giving out thesuperuser password and can't be blamed if he won't give the superuserpassword to anyone. Historically, UNIX systems have tended to be verylax: at many sites, all the users know the superuser password anddon't hesitate to use it whenever they have the slightest problem.</P><PCLASS="para">Common as it may be, this is a very bad practice - systems whereeveryone knows the superuser password have no security whatsoever.People can read each other's mail, trample all over each other'sfiles, scribble on disks by accident, or mail all of the company'sproprietary documentation to a competitor (and delete the log files sothere's no record that they did it).Worse, even if every user is an angel, being superuser makes it easyfor someone to cause big problems accidentally - for instance, typing<CODECLASS="literal">rm *</CODE> in an important directory when you thought you weresomewhere else.Wise system administrators<SPANCLASS="link">don't use their superuser status except when they have to (<ACLASS="linkend"HREF="ch22_22.htm"TITLE="The su Command Isn't Just for the Superuser ">22.22</A>)</SPAN>.</P><PCLASS="para">In this book, we'll assumethat you don't have the superuser password. Almost all ofwhat we describe can be done without becoming superuser.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">ML</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_23.htm"TITLE="1.23 File Access Permissions "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 1.23 File Access Permissions "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch01_25.htm"TITLE="1.25 Access to Directories "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 1.25 Access to Directories "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">1.23 File Access Permissions </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">1.25 Access to Directories </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed & awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -