编号
|
项目
|
注释
|
1
|
禁止普通用户mount文件系统
cd /etc/security
egrep -v '(floppy|cdrom)' console.perms \
> console.perms.new
mv console.perms.new console.perms
grep -v supermount /etc/fstab > /etc/fstab.new
mv /etc/fstab.new /etc/fstab
chown root:root console.perms /etc/fstab
chmod 0600 console.perms
chmod 0644 /etc/fstab
|
|
2
|
对passwd, shadow, 和group文件设置正确的许可权限
|
|
3
|
查找未认证的SUID/SGID可程序:
for part in \
`awk '($3 == "ext2" || $3 == “ext3”) \
{ print $2 }' /etc/fstab`
do
find $part \( -perm -04000 -o -perm -02000 \) \
-type f -xdev -print
done
|
|
4
|
passwd shadow group gshadow 加不可更改属性
chattr +i /etc/passwd
chattr +i /etc/shadow
chattr +i /etc/group
chattr +i /etc/pgshadow
|
|
5
|
资源限制
对你的系统上所有的用户设置资源限制可以防止DoS类型攻击(denial of service attacks)
如最大进程数,内存数量等。例如,对所有用户的限制象下面这样:
编辑/etc/security/limits.conf加
* 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”。
|
|
6
|
禁止 Control-Alt-Delete 重启动机器命令
vi /etc/inittab
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
改成
#ca::ctrlaltdel:/sbin/shutdown -t3 -r now
init q 重新挂起
|
|
7
|
重新设置/etc/rc.d/init.d/目录下所有文件的许可权限
chmod -R 700 /etc/rc.d/init.d/*
仅仅root可以读,写,执行上述所有script file.
|
|
8
|
去掉issue版本说明
echo “echo “”> /etc/issue”>> /etc/rc.d/rc.local
|
暴露过的系统信息
|
9
|
防止单用户登陆
vi /etc/inittab
插入~~:S:wait:/sbin/sulogin
|
接触到了硬件其实没安全可言
|