|
Linux安全配置步骤简述(2) /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.
|