📄 239-241.html
字号:
<HTML>
<HEAD>
<TITLE>Special Edition Using Linux, Fourth Edition:Improving System Security</TITLE>
<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>
-->
<!--ISBN=0789717468//-->
<!--TITLE=Special Edition Using Linux, Fourth Edition//-->
<!--AUTHOR=Jack Tackett//-->
<!--AUTHOR=Jr.//-->
<!--AUTHOR=Steve Burnett//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Que//-->
<!--CHAPTER=12//-->
<!--PAGES=239-241//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="237-239.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="241-243.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading8"></A><FONT COLOR="#000077">Guest Accounts</FONT></H4>
<P>It’s not uncommon for computer centers to provide some type of guest access accounts for visitors so they can use the local computers temporarily. These accounts usually don’t have passwords or have passwords that are the same as the login ID. For example, the login <I>guest</I> might not have a password or has a password of guest. As you might guess, these are security disasters waiting to happen.</P>
<P>Because these accounts and passwords are probably widely known, an intruder could use one to gain initial access to your system. When a cracker has broken into your system, the intruder can then try to get root access from the inside or use your system as a waypoint from which to attack other computers over a network. Tracing an attack back to an open public account makes it much harder to find the true source of the attack.</P>
<P>Guest or open accounts really aren’t a good idea on any system. If you really must use one, keep it disabled until it’s needed. Randomly generate a password for the account when it needs to be used and, when you can, disable it immediately. Remember not to send the password via e-mail.</P>
<H4 ALIGN="LEFT"><A NAME="Heading9"></A><FONT COLOR="#000077">Command Accounts</FONT></H4>
<P>It’s common for computers to have several <I>command accounts</I>—login IDs that run a given command and then exit. For example, finger is an account that has no password. When a user logs in as finger, the <TT>finger</TT> program is run, showing who is on the system, and then the session terminates. Other such accounts may be sync and date, which typically don’t have passwords. Even though they don’t run a shell and run only one command, they can still pose a security risk.</P>
<P>If you allow command accounts on your system, you should ensure that none of these commands accepts command-line input. Also, these commands shouldn’t have any type of shell escape that can allow a user to get to an interactive shell.</P>
<P>A second reason for not using these types of accounts is that they can give away information about your system that can be useful to an intruder. Using programs such as <TT>finger</TT> or <TT>who</TT> as command accounts can allow intruders to get the login IDs of users on your system. Remember that the login ID/password combination protects your accounts. If an intruder gets the login ID of a user, that person now has half the information that’s needed to log in to that account.</P>
<H4 ALIGN="LEFT"><A NAME="Heading10"></A><FONT COLOR="#000077">Group Accounts</FONT></H4>
<P>A group account is an account for which more than one person knows the password and logs in under the same ID. You guessed it—a bad idea. If you have an account shared by several people that is broken into and is being used as a base to attack other computers, finding the person who gave out the password is difficult. If you have an account that’s shared by five people, it may in fact be shared by 25. There’s no way to know.
</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR>• <B>See</B> “Working with Groups,” <B>p. 223</B><HR></FONT>
</BLOCKQUOTE>
<P>Linux allows you to provide file access based on group membership. This way, a group of people who need access to a set of files can share them without needing to share an account. Rather than create group accounts, make wise use of groups under Linux. Stay with the “One Login ID, One Person” philosophy.
</P>
<H3><A NAME="Heading11"></A><FONT COLOR="#000077">Handling File Security</FONT></H3>
<P>The file system under Linux is a tree structure that’s built from files and directories. Linux stores several types of information about each file in its file system, including the following:
</P>
<DL>
<DD><B>•</B> The filename
<DD><B>•</B> The file type
<DD><B>•</B> The file size
<DD><B>•</B> The file’s physical location on disk
<DD><B>•</B> Various access and modification times
<DD><B>•</B> The owner and group ID of the file
<DD><B>•</B> The access permissions associated with the file
</DL>
<P>If a user can modify some of the file information on certain files, security breaches can occur. As a result, the file system plays a very important role in system security.
</P>
<H4 ALIGN="LEFT"><A NAME="Heading12"></A><FONT COLOR="#000077">Permissions</FONT></H4>
<P>Linux file permissions control which users can access which files and commands. These permission bits control access rights for the owner, the associated group members, and other users. By using the <TT>ls -l</TT> command, you can generate a file list that shows the permissions field. The leftmost field shown by <TT>ls -l</TT> specifies the file permissions. For example, this field may look like <TT>-rw-r--r--</TT>. The first <TT>-</TT> in the field shows the file type. For regular files, this field is always <TT>-</TT>.</P>
<P>The next nine characters represent the file access permissions for the owner, group, and world, respectively. Each category takes up three characters in the permissions field, consisting of the characters <TT>r</TT> (for read permission), <TT>w</TT> (for write permission), and <TT>x</TT> (for execute permission). Any or all of these characters may be present.</P>
<P>If one of the permissions has been granted, the corresponding character is present. If permission isn’t granted, there’s a <TT>-</TT> instead. For example, if a file has a permission field that looks like <TT>-rw-r--r--</TT>, this indicates that the file is a regular file (the first character is <TT>-</TT>), the owner has permissions <TT>rw-</TT> (which means read and write, but no execute), and the other group members and the world at large both have permissions <TT>r--</TT> (which means read permission but no write or execute access). File permissions are changed via the <TT>chmod</TT> command.}</P>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR>• <B>See</B> “File Permissions,” <B>p. 310</B><HR></FONT>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P><FONT SIZE="-1"><HR><B>NOTE: </B>You can specify the permissions to the <TT>chmod</TT> command as octal values instead of the <TT>rwx</TT> symbolic values. Simply treat the three characters in a permission field as bits in an octal number—if the character is present, count it as a 1. So, the permissions <TT>-rw-r--r--</TT> are represented numerically as 644.<HR></FONT>
</BLOCKQUOTE>
<P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="237-239.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="241-243.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -