首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
中国IT实验室Linux频道
Google
首页 入门 Linux编程 系统管理 网络管理 Linux认证 Unix/BSD Linux数据库 Linux集群 Linux手册 Linux下载 Ubuntu 论坛 专题 RSS
您现在的位置: 中国IT实验室 >> Linux >> 网络管理 >> Linux安全 >> 正文

Linux操作系统安全配置步骤详细解析

一些细节:

1.操作系统内部的log file是检测是否有网络入侵的重要线索,当然这个假定你的logfile不被侵入者所破坏,如果你有台服务器用专线直接连到Internet上,这意味着你的IP地址是永久固定的地址,你会发现有很多人对你的系统做telnet/ftp登录尝试,试着运行#more /var/log/secure | grep refused 去检查。

2. 限制具有SUID权限标志的程序数量,具有该权限标志的程序以root身份运行,是一个潜在的安全漏洞,当然,有些程序是必须要具有该标志的,象passwd程序。

3.BIOS安全。设置BIOS密码且修改引导次序禁止从软盘启动系统。

4. 用户口令。用户口令是Linux安全的一个最基本的起点,很多人使用的用户口令就是简单的‘password'',这等于给侵入者敞开了大门,虽然从理论上说没有不能确解的用户口令,只要有足够的时间和资源可以利用。比较好的用户口令是那些只有他自己能够容易记得并理解的一串字符,并且绝对不要在任何地方写出来。

5./etc/exports 文件。如果你使用NFS网络文件系统服务,那么确保你的/etc/exports具有最严格的存取权限设置,不意味着不要使用任何通配符,不允许root写权限,mount成只读文件系统。编辑文件/etc/exports并且加:例如:

/dir/to/export host1.mydomain.com(ro,root_squash)

/dir/to/export host2.mydomain.com(ro,root_squash)

/dir/to/export 是你想输出的目录,host.mydomain.com是登录这个目录的机器名,

ro意味着mount成只读系统,root_squash禁止root写入该目录。

为了让上面的改变生效,运行/usr/sbin/exportfs -a

6.确信/etc/inetd.conf的所有者是root,且文件权限设置为600 。

[root@deep]# chmod 600 /etc/inetd.conf

ENSURE that the owner is root.

[root@deep]# stat /etc/inetd.conf

File: "/etc/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禁止以下服务:

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允许所有的请求,用TCP_WRAPPERS增强你的站点的安全性是举手

之劳,你可以放入

“ALL: ALL”到/etc/hosts.deny中禁止所有的请求,然后放那些明确允许的请求到

/etc/hosts.allow中,如:

sshd: 192.168.1.10/255.255.255.0 gate.openarch.com

对IP地址192.168.1.10和主机名gate.openarch.com,允许通过ssh连接。

配置完了之后,用tcpdchk检查

[root@deep]# tcpdchk

tcpchk是TCP_Wrapper配置检查工具,

它检查你的tcp wrapper配置并报告所有发现的潜在/存在的问题。

8. 别名文件aliases

编辑别名文件/etc/aliases(也可能是/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 ?remove 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 should get root''s mail

#root: marc

最后更新后不要忘记运行/usr/bin/newaliases,使改变生效。

上一页  [1] [2] [3] [4] [5] [6] 下一页

【责编:Yoyo】
中国IT教育
相关产品和培训
文章评论
 友情推荐链接
 专题推荐

 ·防范Linux病毒 打造没有病毒的乐土…
 ·Linux Shell编程实用指南…
 ·Linux日志分析与管理
 ·揭密Linux内存管理
 ·邮件服务Sendmail应用配置
 ·Linux 安全管理…
 ·Linux 下DNS服务器架设攻略…
 ·Linux 下的路由的配置与应用…
 ·专题:Apache实用手册
 ·全面剖析Linux文件系统
 今日更新
 认证培训
 频道精选
 Windows频道导航