Linux 网络安全技巧.doc

上传人:壹****1 文档编号:542392181 上传时间:2024-03-22 格式:DOC 页数:11 大小:46KB
返回 下载 相关 举报
Linux 网络安全技巧.doc_第1页
第1页 / 共11页
Linux 网络安全技巧.doc_第2页
第2页 / 共11页
Linux 网络安全技巧.doc_第3页
第3页 / 共11页
Linux 网络安全技巧.doc_第4页
第4页 / 共11页
Linux 网络安全技巧.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《Linux 网络安全技巧.doc》由会员分享,可在线阅读,更多相关《Linux 网络安全技巧.doc(11页珍藏版)》请在金锄头文库上搜索。

1、Linux 网络安全技巧日期:2005-8-28 15:31:21作者:佚名人气: 来源:网络 被屏蔽的广告自助式音乐网站免费大放送CLDE.net技术交流中心大量ASP教程点击进入空间+域名=150元/年 QQ:313747999 文字广告位招商50/月QQ:313747999 网络安全是一个非常重要的课题,基本上你运行的服务后台越多,你就可能打开更多的安全漏洞.如果配置的恰当的话,Linux本身是非常安全可靠的,假使在Linux系统中有某个安全缺陷,由于Linux的源码是开放的,有成千上万的志愿者会立刻发现并修补它。本文旨在介绍用来增强你的网络安全性的常用技巧,以Redhat Linux作

2、为操作环境。 1.操作系统内部的log file是检测是否有网络入侵的重要线索,当然这个假定你的logfile不被侵入者所破坏,如果你有台服务器用专线直接连到Internet上,这意味着你的IP地址是永久固定的地址,你会发现有很多人对你的系统做telnet/ftp登录尝试,试着运行#more /var/log/secure | grep refused 去检查。 2. 限制具有SUID权限标志的程序数量,具有该权限标志的程序以root身份运行,是一个潜在的安全漏洞,当然,有些程序是必须要具有该标志的,象passwd程序。 3.BIOS安全。设置BIOS密码且修改引导次序禁止从软盘启动系统。 4

3、. 用户口令。用户口令是Linux安全的一个最基本的起点,很多人使用的用户口令就是简单的password,这等于给侵入者敞开了大门,虽然从理论上说没有不能确解的用户口令,只要有足够的时间和资源可以利用。比较好的用户口令是那些只有他自己能够容易记得并理解的一串字符,并且绝对不要在任何地方写出来。 5./etc/exports 文件。如果你使用NFS网络文件系统服务,那么确保你的/etc/exports具有最严格的存取权限设置,这意味着不要使用任何通配符,不允许root写权限,mount成只读文件系统。编辑文件/etc/exports并且加:例如: /dir/to/export (ro,root_

4、squash) /dir/to/export (ro,root_squash) /dir/to/export 是你想输出的目录,是登录这个目录的机器名,ro意味着mount成只读系统,root_squash禁止root写入该目录。 为了让上面的改变生效,运行/usr/sbin/exportfs -a 6.确信/etc/inetd.conf的所有者是root,且文件权限设置为600 。 rootdeep# chmod 600 /etc/inetd.conf ENSURE that the owner is root. rootdeep# stat /etc/inetd.conf File: /e

5、tc/inetd.conf Size: 2869 Filetype: Regular File Mode: (0600/-rw-) Uid: ( 0/ root) Gid: ( 0/ root) Device: 8,6 Inode: 18219 Links: 1 Access: Wed Sep 22 16:24:16 1999(00000.00:10:44) Modify: Mon Sep 20 10:22:44 1999(00002.06:12:16) Change:Mon Sep 20 10:22:44 1999(00002.06:12:16) 编辑/etc/inetd.conf禁止以下服

6、务: ftp, telnet, shell, login, exec, talk, ntalk, imap, pop-2, pop-3, finger, auth, etc. 除非你真的想用它。特别是禁止那些r命令.如果你用ssh/scp,那么你也可以禁止掉telnet/ftp。 为了使改变生效,运行#killall -HUP inetd 你也可以运行#chattr +i /etc/inetd.conf使该文件具有不可更改属性。只有root 才能解开,用命令 #chattr -i /etc/inetd.conf 7. TCP_WRAPPERS 默认地,Redhat Linux允许所有的请求,用

7、TCP_WRAPPERS增强你的站点的安全性是举手之劳,你可以放入 “ALL: ALL”到/etc/hosts.deny中禁止所有的请求,然后放那些明确允许的请求到/etc/hosts.allow中,如: sshd: 192.168.1.10/255.255.255.0 对IP地址192.168.1.10和主机名,允许通过ssh连接。配置完了之后,用tcpdchk检查 rootdeep# tcpdchk tcpchk是TCP_Wrapper配置检查工具,它检查你的tcp wrapper配置并报告所有发现的潜在/存在的问题。 8. 别名文件aliases 编辑别名文件/etc/aliases(

8、也可能是/etc/mail/aliases),移走/注释掉下面的行。 # Basic system aliases - these MUST be present. MAILER-DAEMON: postmaster postmaster: root # General redirections for pseudo accounts. bin: root daemon: root #games: root ?remove or comment out. #ingres: root ?remove or comment out. nobody: root #system: root ?remo

9、ve or comment out. #toor: root ?remove or comment out. #uucp: root ?remove or comment out. # Well-known aliases. #manager: root ?remove or comment out. #dumper: root ?remove or comment out. #operator: root ?remove or comment out. # trap decode to catch security attacks #decode: root # Person who sho

10、uld get roots mail #root: marc 最后更新后不要忘记运行/usr/bin/newaliases,使改变生效。 9.阻止你的系统响应任何从外部/内部来的ping请求。 既然没有人能ping通你的机器并收到响应,你可以大大增强你的站点的安全性。你可以加下面的一行命令到/etc/rc.d/rc.local,以使每次启动后自动运行。 echo 1 /proc/sys/net/ipv4/icmp_echo_ignore_all 10. 不要显示出操作系统和版本信息。 如果你希望某个人远程登录到你的服务器时不要显示操作系统和版本信息,你能改变 /etc/inetd.conf中的

11、一行象下面这样: telnet stream tcp nowait root /usr/sbin/tcpd in.telnetd -h 加-h标志在最后使得telnet后台不要显示系统信息,而仅仅显示login: 11.The /etc/host.conf file 编辑host.conf文件(vi /etc/host.conf)且加下面的行: # Lookup names via DNS first then fall back to /etc/hosts. order bind,hosts # We don have machines with multiple IP addresses

12、on the same card (like virtual server,IP Aliasing). multi off # Check for IP address spoofing. nospoof on IP Spoofing: IP-Spoofing is a security exploit that works by tricking computers in a trust relationship that you are someone that you really aren . 12. The /etc/securetty file 该文件指定了允许root登录的tty

13、设备,/etc/securetty被/bin/login程序读取,它的格式是一行一个被允许的名字列表,如你可以编辑/etc/securetty且注释出下面的行。 tty1 #tty2 #tty3 #tty4 #tty5 #tty6 #tty7 #tty8 -意味着root仅仅被允许在tty1终端登录。 13. 特别的帐号 禁止所有默认的被操作系统本身启动的且不需要的帐号,当你第一次装上系统时就应该做此检查,Linux提供了各种帐号,你可能不需要,如果你不需要这个帐号,就移走它,你有的帐号越多,就越容易受到攻击。 为删除你系统上的用户,用下面的命令: rootdeep# userdel user

14、name 为删除你系统上的组用户帐号,用下面的命令: rootdeep# groupdel username 在终端上打入下面的命令删掉下面的用户。 rootdeep# userdel adm rootdeep# userdel lp rootdeep# userdel sync rootdeep# userdel shutdown rootdeep# userdel halt rootdeep# userdel mail 如果你不用sendmail服务器,procmail.mailx,就删除这个帐号。 rootdeep# userdel news rootdeep# userdel uucp

15、 rootdeep# userdel operator rootdeep# userdel games 如果你不用X windows 服务器,就删掉这个帐号。 rootdeep# userdel gopher rootdeep# userdel ftp 如果你不允许匿名FTP,就删掉这个用户帐号。 = 打入下面的命令删除组帐号 rootdeep# groupdel adm rootdeep# groupdel lp rootdeep# groupdel mail 如不用Sendmail服务器,删除这个组帐号 rootdeep# groupdel news rootdeep# groupdel uucp rootdeep# groupdel

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号