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

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

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

  21. 被root拥有的程序的位。

  移走那些被root拥有程序的s位标志,当然有些程序需要这个,用命令‘chmod a-s’完成这个。

  注:前面带(*)号的那些程序一般不需要拥有s位标志。

  [root@deep]# find / -type f \( -perm -04000 -o -perm -02000 \) \-exec ls –lg {} \;
  -rwsr-xr-x 1 root root 33120 Mar 21 1999 /usr/bin/at
  *-rwsr-xr-x 1 root root 30560 Apr 15 20:03 /usr/bin/chage
  *-rwsr-xr-x 1 root root 29492 Apr 15 20:03 /usr/bin/gpasswd
  -rwsr-xr-x 1 root root 3208 Mar 22 1999 /usr/bin/disable-paste
  -rwxr-sr-x 1 root man 32320 Apr 9 1999 /usr/bin/man
  -r-s--x--x 1 root root 10704 Apr 14 17:21 /usr/bin/passwd
  -rws--x--x 2 root root 517916 Apr 6 1999 /usr/bin/suidperl
  -rws--x--x 2 root root 517916 Apr 6 1999 /usr/bin/sperl5.00503
  -rwxr-sr-x 1 root mail 11432 Apr 6 1999 /usr/bin/lockfile
  -rwsr-sr-x 1 root mail 64468 Apr 6 1999 /usr/bin/procmail
  -rwsr-xr-x 1 root root 21848 Aug 27 11:06 /usr/bin/crontab
  -rwxr-sr-x 1 root slocate 15032 Apr 19 14:55 /usr/bin/slocate
  *-r-xr-sr-x 1 root tty 6212 Apr 17 11:29 /usr/bin/wall
  *-rws--x--x 1 root root 14088 Apr 17 12:57 /usr/bin/chfn
  *-rws--x--x 1 root root 13800 Apr 17 12:57 /usr/bin/chsh
  *-rws--x--x 1 root root 5576 Apr 17 12:57 /usr/bin/newgrp
  *-rwxr-sr-x 1 root tty 8392 Apr 17 12:57 /usr/bin/write
  -rwsr-x--- 1 root squid 14076 Oct 7 14:48 /usr/lib/squid/pinger
  -rwxr-sr-x 1 root utmp 15587 Jun 9 09:30 /usr/sbin/utempter
  *-rwsr-xr-x 1 root root 5736 Apr 19 15:39 /usr/sbin/usernetctl
  *-rwsr-xr-x 1 root bin 16488 Jul 6 09:35 /usr/sbin/traceroute
  -rwsr-sr-x 1 root root 299364 Apr 19 16:38 /usr/sbin/sendmail
  -rwsr-xr-x 1 root root 34131 Apr 16 18:49 /usr/libexec/pt_chown
  -rwsr-xr-x 1 root root 13208 Apr 13 14:58 /bin/su
  *-rwsr-xr-x 1 root root 52788 Apr 17 15:16 /bin/mount
  *-rwsr-xr-x 1 root root 26508 Apr 17 20:26 /bin/umount
  *-rwsr-xr-x 1 root root 17652 Jul 6 09:33 /bin/ping
  -rwsr-xr-x 1 root root 20164 Apr 17 12:57 /bin/login
  *-rwxr-sr-x 1 root root 3860 Apr 19 15:39 /sbin/netreport
  -r-sr-xr-x 1 root root 46472 Apr 17 16:26 /sbin/pwdb_chkpwd
  [root@deep]# chmod a-s /usr/bin/chage
  [root@deep]# chmod a-s /usr/bin/gpasswd
  [root@deep]# chmod a-s /usr/bin/wall
  [root@deep]# chmod a-s /usr/bin/chfn
  [root@deep]# chmod a-s /usr/bin/chsh
  [root@deep]# chmod a-s /usr/bin/newgrp
  [root@deep]# chmod a-s /usr/bin/write
  [root@deep]# chmod a-s /usr/sbin/usernetctl
  [root@deep]# chmod a-s /usr/sbin/traceroute
  [root@deep]# chmod a-s /bin/mount
  [root@deep]# chmod a-s /bin/umount
  [root@deep]# chmod a-s /bin/ping
  [root@deep]# chmod a-s /sbin/netreport

  你可以用下面的命令查找所有带s位标志的程序:

  [root@deep]# find / -type f \( -perm -04000 -o -perm -02000 \) \-exec ls -lg {} \; 
> suid-sgid-results

  把结果输出到文件suid-sgid-results中。

  为了查找所有可写的文件和目录,用下面的命令:

  [root@deep]# find / -type f \( -perm -2 -o -perm -20 \) -exec ls -lg {} \; > ww-files-results
  [root@deep]# find / -type d \( -perm -2 -o -perm -20 \) -exec ls -ldg {} \; > ww-directories-results

  用下面的命令查找没有拥有者的文件:

  [root@deep]# find / -nouser -o -nogroup > unowed-results

  用下面的命令查找所有的.rhosts文件:

  [root@deep]# find /home -name .rhosts > rhost-results

  建议替换的常见网络服务应用程序

  WuFTPD

  WuFTD从1994年就开始就不断地出现安全漏洞,黑客很容易就可以获得远程root访问(Remote Root Access)的权限,而且很多安全漏洞甚至不需要在FTP服务器上有一个有效的帐号。最近,WuFTP也是频频出现安全漏洞。

  它的最好的替代程序是ProFTPD。ProFTPD很容易配置,在多数情况下速度也比较快,而且它的源代码也比较干净(缓冲溢出的错误比较少)。有许多重要的站点使用ProFTPD。sourceforge.net就是一个很好的例子(这个站点共有3,000个开放源代码的项目,其负荷并不小啊!)。一些Linux的发行商在它们的主FTP站点上使用的也是ProFTPD,只有两个主要Linux的发行商(SuSE和Caldera)使用WuFTPD。

  ProFTPD的另一个优点就是既可以从inetd运行又可以作为单独的daemon运行。这样就可以很容易解决inetd带来的一些问题,如:拒绝服务的攻击(denial of service attack),等等。系统越简单,就越容易保证系统的安全。WuFTPD要么重新审核一遍全部的源代码(非常困难),要么完全重写一遍代码,否则WuFTPD必然要被ProFTPD代替。转 载:http://www.qqread.com/linux/s461246206.html 更多文章 更多内容请看路由安全配置专题Windows操作系统安装系统优化大全专题,或进入讨论组讨论。

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

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