📄 488.html
字号:
<form action="http://www.linuxhero.com/docs/search.html" method=get>
<table
style="BORDER-RIGHT: #c4c4c4 1px solid; BORDER-TOP: #c4c4c4 1px solid; BORDER-LEFT: #c4c4c4 1px solid; BORDER-BOTTOM: #c4c4c4 1px solid"
cellspacing=0 cellpadding=3 width="95%" border=0 align="center">
<tbody>
<tr>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif">
<div align=center><font class=normalfont>搜索文章:
<input type=hidden value=result name=action2>
<input type=radio checked value=title name=type>标题
<input type=radio value=content name=type>内容
<input type=image src="images/button_go.gif" tppabs="http://www.linuxhero.com/docs/images/button_go.gif" border=0 name=image2>
</font></div>
</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="type5.html" tppabs="http://www.linuxhero.com/docs/type5.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> 本文讲述了如何通过基本的安全措施,使你的linux系统变得可靠。<br>
1、Bios Security<br>
一定要给Bios设置密码,以防通过在Bios中改变启动顺序,而可以从软盘启动。这样
可以阻止别人试图用特殊的启动盘启动你的系统,还可以阻止别人进入Bios改动其中的设
置(比如允许通过软盘启动等)。<br>
2、LILO Security<br>
在“/etc/lilo.conf”文件中加入下面三个参数:time-out,restricted,password。这
三个参数可以使你的系统在启动lilo时就要求密码验证。<br>
第一步:<br>
编辑lilo.conf文件(vi /etc/lilo.comf),假如或改变这三个参数:<br>
boot=/dev/hda<br>
map=/boot/map<br>
install=/boot/boot.b<br>
time-out=00 #把这行改为00<br>
prompt<br>
Default=linux<br>
restricted #加入这行<br>
password=<password> #加入这行并设置自己的密码<br>
image=/boot/vmlinuz-2.2.14-12<br>
label=linux<br>
initrd=/boot/initrd-2.2.14-12.img<br>
root=/dev/hda6<br>
read-only<br>
第二步:<br>
因为"/etc/lilo.conf"文件中包含明文密码,所以要把它设置为root权限读取。<br>
[root@kapil /]# chmod 600 /etc/lilo.conf<br>
第三步:<br>
更新系统,以便对“/etc/lilo.conf”文件做的修改起作用。<br>
[Root@kapil /]# /sbin/lilo -v<br>
第四步:<br>
使用“chattr”命令使"/etc/lilo.conf"文件变为不可改变。<br>
[root@kapil /]# chattr +i /etc/lilo.conf<br>
这样可以防止对“/etc/lilo.conf”任何改变(意外或其他原因)<br>
3、删除所有的特殊账户<br>
你应该删除所有不用的缺省用户和组账户(比如lp, sync, shutdown, halt, news,
uucp, operator, games, gopher等)。<br>
删除用户:<br>
[root@kapil /]# userdel LP<br>
删除组:<br>
[root@kapil /]# groupdel LP<br>
4、选择正确的密码<br>
在选择正确密码之前还应作以下修改:<br>
修改密码长度:在你安装linux时默认的密码长度是5个字节。但这并不够,要把它设
为8。修改最短密码长度需要编辑login.defs文件(vi /etc/login.defs),把下面这行<br>
PASS_MIN_LEN 5<br>
改为<br>
PASS_MIN_LEN 8<br>
login.defs文件是login程序的配置文件。<br>
5、打开密码的shadow支持功能:<br>
你应该打开密码的shadow功能,来对password加密。使用“/usr/sbin/authconfig”
工具打开shadow功能。如果你想把已有的密码和组转变为shadow格式,可以分别使用
“pwcov,grpconv”命令。<br>
6、root账户<br>
在unix系统中root账户是具有最高特权的。如果系统管理员在离开系统之前忘记注销
root账户,系统会自动注销。通过修改账户中“TMOUT”参数,可以实现此功能。TMOUT按秒
计算。编辑你的profile文件(vi /etc/profile),在"HISTFILESIZE="后面加入下面这行:<br>
TMOUT=3600<br>
3600,表示60*60=3600秒,也就是1小时。这样,如果系统中登陆的用户在一个小时
内都没有动作,那么系统会自动注销这个账户。你可以在个别用户的“.bashrc”文件中添
加该值,以便系统对该用户实行特殊的自动注销时间。<br>
改变这项设置后,必须先注销用户,再用该用户登陆才能激活这个功能。<br>
7、取消普通用户的控制台访问权限<br>
你应该取消普通用户的控制台访问权限,比如shutdown、reboot、halt等命令。<br>
[root@kapil /]# rm -f /etc/security/console.apps/<servicename><br>
<servicename>是你要注销的程序名。<br>
8、取消并反安装所有不用的服务<br>
取消并反安装所有不用的服务,这样你的担心就会少很多。察看“/etc/inetd.conf”
文件,通过注释取消所有你不需要的服务(在该服务项目之前加一个“#”)。然后用
“sighup”命令升级“inetd.conf”文件。<br>
第一步:<br>
更改“/etc/inetd.conf”权限为600,只允许root来读写该文件。<br>
[Root@kapil /]# chmod 600 /etc/inetd.conf<br>
第二步:<br>
确定“/etc/inetd.conf”文件所有者为root。<br>
第三步:<br>
编辑 /etc/inetd.conf文件(vi /etc/inetd.conf),取消下列服务(你不需要的):
ftp, telnet, shell, login, exec, talk, ntalk, imap, pop-2, pop-3, finger, auth
等等。把不需要的服务关闭可以使系统的危险性降低很多。<br>
第四步:<br>
给inetd进程发送一个HUP信号:<br>
[root@kapil /]# killall -HUP inetd<br>
第五步:<br>
用chattr命令把/ec/inetd.conf文件设为不可修改,这样就没人可以修改它:<br>
[root@kapil /]# chattr +i /etc/inetd.conf<br>
这样可以防止对inetd.conf的任何修改(以外或其他原因)。唯一可以取消这个属性
的人只有root。如果要修改inetd.conf文件,首先要是取消不可修改性质:<br>
[root@kapil /]# chattr -i /etc/inetd.conf<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -