免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 958 | 回复: 0
打印 上一主题 下一主题

LINUX加固 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-05-26 17:22 |只看该作者 |倒序浏览


LINUX加固

1.禁止Ctrl+Alt+Delete重新启动机器
  修改/etc/inittab文件,将“ca::ctrlaltdel:/sbin/shutdown -t3 -r now”一行注
释掉。

2.禁止非正常用户登录
    # usermod –s /sbin/nologin adm,lp,mail,news,uucp,games,dip
3. 登录超时限制
Vi /etc/profile
TMOUT = 600
4. 设置密码长度
编辑login.defs文件(vi /etc/login.defs),把下面这行
PASS_MIN_LEN    8
5. 删减登录信息
  编辑/etc/rc.d/rc.local将输出系统信息的如下行注释掉。
  # This will overwrite /etc/issue at every boot. So,make any changes you
  # want to make to /etc/issue here or you will lose them when you reboot
  # echo "">/etc/issue
  # echo "">>/etc/issue
  # echo "Kernel 100 100uname -r) on 100 100uname -m)">>/etc/issue
  # cp -f /etc/issue /etc/issue.net
  # echo>>/etc/issue
  然后,进行如下操作:
  # rm -f /etc/issue
  # rm -f /etc/issue.net
  # touch /etc/issue
  # touch /etc/issue.net
6.停止不需要的服务
# chkconfig –list
# chkconfig –level 3 servicename off
编辑修改/etc/rc.d/rc3.d 下的文件
7.禁止root用户远程登录:
编辑 /etc/ssh/sshd_config
PermitRootLogin no
8.防止IP欺骗
  编辑host.conf文件并增加如下几行来防止IP欺骗攻击。
  order bind,hosts
  multi off
  nospoof on
9.取消普通用户的控制台访问权限
比如shutdown、reboot、halt等命令。
# rm -f /etc/security/console.apps/

10.使用TCP_WRAPPERS
编辑hosts.deny文件(vi /etc/hosts.deny),加入下面这行
# Deny access to everyone.
ALL: ALL@ALL, PARANOID
编辑hosts.allow文件(vi /etc/hosts.allow),加入允许访问的主机列表,比如:
ftp: 202.54.15.99 foo.com
202.54.15.99和 foo.com是允许访问ftp服务的ip地址和主机名称。
tcpdchk程序是tepd wrapper设置检查程序。设置完后,运行下面这个命令:
# tcpdchk


11.禁止从不同的控制台进行root登陆
编辑"/etc/securetty"文件,不需要登陆的TTY设备前添加“#”标志,来禁止从该TTY设备进行root登陆。
12.限制"/etc/rc.d/init.d" 下script文件设置权限
# chmod -R 700 /etc/rc.d/init.d/*
只有root才允许读、写、执行该目录下的script文件。





本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/51067/showart_1945512.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP