📄 1117.html
字号:
</td>
</tr>
<tr>
<td noWrap>
<div align="center">
<input maxlength=100 size=30 name=keyword2>
</div>
</td>
</tr></tbody>
</table>
</form>
</TD>
<TD rowSpan=2><IMG src="images/header_r1_c7.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c7.gif" width=26 border=0 name=header_r1_c7></TD>
<TD><IMG height=83 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1 border=0></TD></TR>
<TR>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif"><IMG height=22
src="images/header_r2_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r2_c1.gif" width=296 border=0
name=header_r2_c1></TD>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colSpan=5>
<DIV align=right><FONT class=normalfont>当前位置:
<A href="index.html" tppabs="http://www.linuxhero.com/docs/index.html">本站首页</A>
<font color="#FF6699">>></font>
<A href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</A> | <A href="copyright.html" tppabs="http://www.linuxhero.com/docs/copyright.html">版权说明</A></font></DIV>
</TD>
<TD><IMG height=22 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=10 cellPadding=0 width="100%" bgColor=#ffffff
border=0>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TR>
<TD vAlign=top align=middle width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
background="images/back.gif" tppabs="http://www.linuxhero.com/docs/images/back.gif" border=0>
<TBODY>
<TR>
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color=blue>Linux安全配置步骤简述</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br>一、磁盘分区<br>
<br>
1、如果是新安装系统,对磁盘分区应考虑安全性:<br>
1)根目录(/)、用户目录(/home)、临时目录(/tmp)和/var目录应分开到不同的磁盘分区;<br>
2)以上各目录所在分区的磁盘空间大小应充分考虑,避免因某些原因造成分区空间用完而导致系统崩溃;<br>
<br>
2、对于/tmp和/var目录所在分区,大多数情况下不需要有suid属性的程序,所以应为这些分区添加nosuid属性;<br>
方法一:修改/etc/fstab文件,添加nosuid属性字。例如:<br>
<br>
/dev/hda2 /tmp ext2 exec,dev,nosuid,rw 0 0<br>
^^^^^^<br>
方法二:如果对/etc/fstab文件操作不熟,建议通过linuxconf程序来修改。<br>
<br>
* 运行linuxconf程序;<br>
* 选择"File systems"下的"Access local drive";<br>
* 选择需要修改属性的磁盘分区;<br>
* 选择"No setuid programs allowed"选项;<br>
* 根据需要选择其它可选项;<br>
* 正常退出。(一般会提示重新mount该分区)<br>
<br>
<br>
二、安装<br>
<br>
1、对于非测试主机,不应安装过多的软件包。这样可以降低因软件包而导致出现安全漏洞的可能性。<br>
2、对于非测试主机,在选择主机启动服务时不应选择非必需的服务。例如routed、ypbind等。<br>
<br>
<br>
三、安全配置与增强<br>
<br>
内核升级。起码要升级至2.2.16以上版本。<br>
GNU libc共享库升级。(警告:如果没有经验,不可轻易尝试。可暂缓。)<br>
关闭危险的网络服务。echo、chargen、shell、login、finger、NFS、RPC等<br>
关闭非必需的网络服务。talk、ntalk、pop-2等<br>
常见网络服务安全配置与升级<br>
确保网络服务所使用版本为当前最新和最安全的版本。<br>
取消匿名FTP访问<br>
去除非必需的suid程序<br>
使用tcpwrapper<br>
使用ipchains防火墙<br>
日志系统syslogd<br>
<br>
<br>
一些细节:<br>
<br>
1.操作系统内部的log file是检测是否有网络入侵的重要线索,当然这个假定你的logfile不被侵入者所破坏,如果你有台服务器用专线直接连到Internet上,这意味着你的IP地址是永久固定的地址,你会发现有很多人对你的系统做telnet/ftp登录尝试,试着运行#more /var/log/secure | grep refused 去检查。<br>
<br>
2. 限制具有SUID权限标志的程序数量,具有该权限标志的程序以root身份运行,是一个潜在的安全漏洞,当然,有些程序是必须要具有该标志的,象passwd程序。<br>
<br>
3.BIOS安全。设置BIOS密码且修改引导次序禁止从软盘启动系统。<br>
<br>
4. 用户口令。用户口令是Linux安全的一个最基本的起点,很多人使用的用户口令就是简单的‘password',这等于给侵入者敞开了大门,虽然从理论上说没有不能确解的用户口令,只要有足够的时间和资源可以利用。比较好的用户口令是那些只有他自己能够容易记得并理解的一串字符,并且绝对不要在任何地方写出来。<br>
<br>
5./etc/exports 文件。如果你使用NFS网络文件系统服务,那么确保你的/etc/exports具有最严格的存取权限设置,不意味着不要使用任何通配符,不允许root写权限,mount成只读文件系统。编辑文件/etc/exports并且加:例如:<br>
<br>
/dir/to/export host1.mydomain.com(ro,root_squash)<br>
/dir/to/export host2.mydomain.com(ro,root_squash)<br>
<br>
/dir/to/export 是你想输出的目录,host.mydomain.com是登录这个目录的机器名,<br>
ro意味着mount成只读系统,root_squash禁止root写入该目录。<br>
为了让上面的改变生效,运行/usr/sbin/exportfs -a<br>
<br>
6.确信/etc/inetd.conf的所有者是root,且文件权限设置为600 。<br>
[root@deep]# chmod 600 /etc/inetd.conf<br>
ENSURE that the owner is root.<br>
[root@deep]# stat /etc/inetd.conf<br>
File: "/etc/inetd.conf"<br>
Size: 2869 Filetype: Regular File<br>
Mode: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)<br>
Device: 8,6 Inode: 18219 Links: 1<br>
Access: Wed Sep 22 16:24:16 1999(00000.00:10:44)<br>
Modify: Mon Sep 20 10:22:44 1999(00002.06:12:16)<br>
Change:Mon Sep 20 10:22:44 1999(00002.06:12:16)<br>
<br>
编辑/etc/inetd.conf禁止以下服务:<br>
ftp, telnet, shell, login, exec, talk, ntalk, imap, pop-2, pop-3, finger,<br>
auth, etc. 除非你真的想用它。<br>
特别是禁止那些r命令.如果你用ssh/scp,那么你也可以禁止掉telnet/ftp。<br>
<br>
为了使改变生效,运行#killall -HUP inetd<br>
你也可以运行#chattr +i /etc/inetd.conf使该文件具有不可更改属性。<br>
只有root才能解开,用命令<br>
#chattr -i /etc/inetd.conf<br>
<br>
7. TCP_WRAPPERS<br>
默认地,Redhat Linux允许所有的请求,用TCP_WRAPPERS增强你的站点的安全性是举手<br>
之劳,你可以放入<br>
“ALL: ALL”到/etc/hosts.deny中禁止所有的请求,然后放那些明确允许的请求到<br>
/etc/hosts.allow中,如:<br>
sshd: 192.168.1.10/255.255.255.0 gate.openarch.com<br>
对IP地址192.168.1.10和主机名gate.openarch.com,允许通过ssh连接。<br>
配置完了之后,用tcpdchk检查<br>
<br>
[root@deep]# tcpdchk<br>
tcpchk是TCP_Wrapper配置检查工具,<br>
它检查你的tcp wrapper配置并报告所有发现的潜在/存在的问题。<br>
<br>
8. 别名文件aliases<br>
编辑别名文件/etc/aliases(也可能是/etc/mail/aliases),移走/注释掉下面的行。<br>
<br>
# Basic system aliases -- these MUST be present.<br>
MAILER-DAEMON: postmaster<br>
postmaster: root<br>
# General redirections for pseudo accounts.<br>
bin: root<br>
daemon: root<br>
#games: root ?remove or comment out.<br>
#ingres: root ?remove or comment out.<br>
nobody: root<br>
#system: root ?remove or comment out.<br>
#toor: root ?remove or comment out.<br>
#uucp: root ?remove or comment out.<br>
# Well-known aliases.<br>
#manager: root ?remove or comment out.<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -