频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

如何配置安全的Linux操作系统

来源:chinaunix.net 作者: 出处:巧巧读书 2006-01-27 进入讨论组
上一页 1 2 3 4 5 6 7 下一页 

  14. 阻止任何人su作为root.

  如果你不想任何人能够su作为root,你能编辑/etc/pam.d/su加下面的行:

  auth sufficient /lib/security/pam_rootok.so debug
  auth required /lib/security/pam_wheel.so group=isd

  意味着仅仅isd组的用户可以su作为root.

  然后,如果你希望用户admin能su作为root.就运行下面的命令。

  [root@deep]# usermod -G10 admin

  16. 资源限制

  对你的系统上所有的用户设置资源限制可以防止DoS类型攻击(denial of service attacks)如最大进程数,内存数量等。例如,对所有用户的限制象下面这样:

  编辑/etc/security/limits.con加:

  * hard core 0
  * hard rss 5000
  * hard nproc 20

  你也必须编辑/etc/pam.d/login文件加/检查这一行的存在。

  session required /lib/security/pam_limits.so

  上面的命令禁止core files“core 0”,限制进程数为“nproc 50“,且限制内存使用为5M“rss 5000”。

  17. The /etc/lilo.conf file

  a) Add: restricted
  加这一行到每一个引导映像下面,就这表明如果你引导时用(linux single),则需要一个password.

  b) Add: password=some_password
  当与restricted联合用,且正常引导时,需要用户输入密码,你也要确保lilo.conf文件不能被不属于root的用户可读,也免看到密码明文。下面是例子:

  编辑/etc/lilo.conf加:
  ====
  boot=/dev/sda
  map=/boot/map
  install=/boot/boot.b
  prompt
  timeout=50
  Default=linux
  restricted ?add this line.
  password=some_password ?add this line.
  image=/boot/vmlinuz-2.2.12-20
  label=linux
  initrd=/boot/initrd-2.2.12-10.img
  root=/dev/sda6
  read-only
  [root@deep]# chmod 600 /etc/lilo.conf (不再能被其他用户可读).
  [root@deep]# /sbin/lilo -v (更新lilo配置).
  [root@deep]# chattr +i /etc/lilo.conf(阻止该文件被修改)

  18. 禁止 Control-Alt-Delete 重启动机器命令

  [root@deep]# vi /etc/inittab
  ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  To
  #ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  [root@deep]# /sbin/init q

  19. 重新设置/etc/rc.d/init.d/目录下所有文件的许可权限

  [root@deep]# chmod -R 700 /etc/rc.d/init.d/*
  仅仅root可以读,写,执行上述所有script file.

  20. The /etc/rc.d/rc.local file

  默认地,当你login到linux server时,它告诉你linux版本名,内核版本名和服务器主机名。它给了你太多的信息,如果你就希望得到提示login: ,编辑/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 "$R" >> /etc/issue
  #echo "Kernel $(uname -r) on $a $(uname -m)" >> /etc/issue
  #
  #cp -f /etc/issue /etc/issue.net
  #echo >> /etc/issue

  然后,做下面的事情:
  [root@deep]# rm -f /etc/issue
  [root@deep]# rm -f /etc/issue.net
  [root@deep]# touch /etc/issue
  [root@deep]# touch /etc/issue.net保留地址 http://www.qqread.com/linux/s461246206.html 更多文章 更多内容请看路由安全配置专题Windows操作系统安装系统优化大全专题,或进入讨论组讨论。

上一页 1 2 3 4 5 6 7 下一页 
收藏此文】【 】【打印】【关闭
较早的文章:Linux值得信任吗?

较新的文章:Linux操作系统发展简史
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
讨论组问题推荐
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章