📄 1076.html
字号:
# We have machines with multiple IP addresses.
<br>
multi on
<br>
# Check for IP address spoofing.
<br>
nospoof on
<br>
<br>
第一项设置首先通过DNS解析IP地址,然后通过hosts文件解析。第二项设置检测是否“/etc/hosts”文件中的主机是否拥有多个IP地址(比如有多个以太口网卡)。第三项设置说明要注意对本机未经许可的电子欺骗。
<br>
<br>
9、使“/etc/services”文件免疫
<br>
<br>
使“/etc/services”文件免疫,防止未经许可的删除或添加服务:
<br>
# chattr +i /etc/services
<br>
<br>
10、不允许从不同的控制台进行root登陆
<br>
<br>
"/etc/securetty"文件允许你定义root用户可以从那个TTY设备登陆。你可以编辑"/etc/securetty"文件,再不需要登陆的TTY设备前添加“#”标志,来禁止从该TTY设备进行root登陆。
<br>
<br>
在/etc/inittab文件中有如下一段话:
<br>
# Run gettys in standard runlevels
<br>
1:2345:respawn:/sbin/mingetty tty1
<br>
2:2345:respawn:/sbin/mingetty tty2
<br>
#3:2345:respawn:/sbin/mingetty tty3
<br>
#4:2345:respawn:/sbin/mingetty tty4
<br>
#5:2345:respawn:/sbin/mingetty tty5
<br>
#6:2345:respawn:/sbin/mingetty tty6
<br>
<br>
系统默认的可以使用6个控制台,即Alt+F1,Alt+F2...,这里在3,4,5,6前面加上“#”,注释该句话,这样现在只有两个控制台可供使用,最好保留两个。然后重新启动init进程,改动即可生效!
<br>
<br>
11、使用PAM(可插拔认证模块)禁止任何人通过su命令改变为root用户su(Substitute
<br>
<br>
User替代用户)命令允许你成为系统中其他已存在的用户。如果你不希望任何人通过su命令改变为root用户或对某些用户限制使用su命令,你可以在su配置文件(在"/etc/pam.d/"目录下)的开头添加下面两行:
<br>
编辑su文件(vi /etc/pam.d/su),在开头添加下面两行:
<br>
auth sufficient /lib/security/pam_rootok.so
<br>
auth required /lib/security/Pam_wheel.so group=wheel
<br>
<br>
这表明只有"wheel"组的成员可以使用su命令成为root用户。你可以把用户添加到“wheel”组,以使它可以使用su命令成为root用户。添加方法可以用这个命令:chmod -G10 username 。
<br>
<br>
12、Shell logging Bash
<br>
<br>
shell在“~/.bash_history”(“~/”表示用户目录)文件中保存了500条使用过的命令,这样可以使你输入使用过的长命令变得容易。每个在系统中拥有账号的用户在他的目录下都有一个“.bash_history”文件。bash
<br>
shell应该保存少量的命令,并且在每次用户注销时都把这些历史命令删除。
<br>
<br>
第一步:
<br>
<br>
“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行确定所有用户的“.bash_history”文件中可以保存的旧命令条数。强烈建议把把“/etc/profile”文件中的“HISTFILESIZE”和“HISTSIZE”行的值设为一个较小的数,比如30。编辑profile文件(vi/etc/profile),把下面这行改为:
<br>
HISTFILESIZE=30
<br>
HISTSIZE=30
<br>
<br>
这表示每个用户的“.bash_history”文件只可以保存30条旧命令。
<br>
<br>
第二步:
<br>
<br>
网管还应该在"/etc/skel/.bash_logout" 文件中添加下面这行"rm -f $HOME/.bash_history" 。这样,当用户每次注销时,“.bash_history”文件都会被删除。
<br>
<br>
编辑.bash_logout文件(vi /etc/skel/.bash_logout) ,添加下面这行:
<br>
rm -f $HOME/.bash_history
<br>
<br>
13、禁止Control-Alt-Delete键盘关闭命令
<br>
<br>
在"/etc/inittab" 文件中注释掉下面这行(使用#):
<br>
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
<br>
改为:
<br>
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now
<br>
<br>
为了使这项改动起作用,输入下面这个命令:
<br>
# /sbin/init q
<br>
<br>
14、给"/etc/rc.d/init.d" 下script文件设置权限
<br>
<br>
给执行或关闭启动时执行的程序的script文件设置权限。
<br>
# chmod -R 700 /etc/rc.d/init.d/*
<br>
<br>
这表示只有root才允许读、写、执行该目录下的script文件。
<br>
<br>
15、隐藏系统信息
<br>
<br>
在缺省情况下,当你登陆到linux系统,它会告诉你该linux发行版的名称、版本、内核版本、服务器的名称。对于黑客来说这些信息足够它入侵你的系统了。你应该只给它显示一个“login:”提示符。
<br>
<br>
首先编辑"/etc/rc.d/rc.local" 文件,在下面显示的这些行前加一个“#”,把输出信息的命令注释掉。
<br>
# This will overwrite /etc/issue at every boot. So, make any changes you
<br>
# want to make to /etc/issue here or you will lose them when you reboot.
<br>
#echo "" > /etc/issue
<br>
#echo "$R" >> /etc/issue
<br>
#echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue
<br>
#
<br>
#cp -f /etc/issue /etc/issue.net
<br>
#echo >> /etc/issue
<br>
<br>
其次删除"/etc"目录下的“isue.net”和"issue"文件:
<br>
# rm -f /etc/issue
<br>
# rm -f /etc/issue.net
<br>
<br>
16、禁止不使用的SUID/SGID程序
<br>
<br>
如果一个程序被设置成了SUID
<br>
<br>
root,那么普通用户就可以以root身份来运行这个程序。网管应尽可能的少使用SUID/SGID 程序,禁止所有不必要的SUID/SGID程序。
<br>
<br>
查找root-owned程序中使用s位的程序:
<br>
# find / -type f ( -perm -04000 -o -perm -02000 ) -exec ls -lg {} ;
<br>
<br>
用下面命令禁止选中的带有s位的程序:
<br>
# chmod a-s [program]
<br>
<br>
以上这些都是一些维护系统安全所需要的一些基本的比较简单的步骤,要想让你的系统更加安全,还需要做很多,如配置OpenSSL等,维护系统的稳定和安全是一个持续的长久的工作,需要花大量的时间和精力。这里仅仅列出一些我平时工作的一些心得,和大家交流一下!
<br>
<br>
</FONT><br>
</TD>
</TR>
<TR>
<TD colSpan=2><FONT
class=middlefont></FONT><BR>
<FONT
class=normalfont>全文结束</FONT> </TD>
</TR>
<TR>
<TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2
height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
<TD vAlign=top width="20%"
background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2>
<DIV align=center>
<table class=tableoutline cellspacing=1 cellpadding=4
width="100%" align=center border=0>
<tr class=firstalt>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
<font class=normalfont><b>所有分类</b></font></td>
</tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td> </tr> </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td> </tr> </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%> <table width=100% border=0> <tr> <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td> </tr> </table></td></tr> </table>
</DIV></TD></TR>
<TR vAlign=top>
<TD width="80%">
<DIV align=center><BR>
</DIV>
</TD></TR></TBODY></TABLE></TD></TR>
</TABLE></TD></TR>
</TABLE>
<TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee
border=0><TBODY>
<TR>
<TD width="50%">
<P><FONT class=middlefont>版权所有 © 2004 <A
href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
违者必究. </FONT></P>
</TD>
<TD width="50%">
<DIV align=right><FONT class=middlefont>Powered by: <A
href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
</TD></TR></TBODY></TABLE>
<CENTER></CENTER></TD></TR>
</TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -