禁止root用户远程telnet登录
vim /etc/pam.d/login
auth required pam_securetty.so
禁止root用户远程ssh登录
vim /etc/ssh/sshd_config
PermitRootLogin no
重启服务
/etc/init.d/sshd restart
在/etc/pam.d/system-auth中设置口令最小长度
vim /etc/pam.d/system-auth
password required pam_cracklib.so minlen=6
设置命令行界面超时退出(文件末尾添加)
vi /etc/profile
export TMOUT=180
禁止icmp重定向,icmp源路由`
1.备份配置文件
#cp -p /etc/sysctl.conf /etc/sysctl.conf.bak
2.执行命令
#sysctl -w net.ipv4.conf.all.accept_redirects="0"
#sysctl -w net.ipv4.conf.all.accept_source_route="0"
sysctl -p
配置定时自动屏幕锁定(适用于具备图形界面的设备)
1启用空闲激活 2启用屏保 3启用空闲激活时间 4启用屏幕锁定
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type bool \
--set /apps/gnome-screensaver/idle_activation_enabled true
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type string \
--set /apps/gnome-screensaver/mode blank-only
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type int \
--set /apps/gnome-screensaver/idle_delay 15
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type bool \
--set /apps/gnome-screensaver/lock_enabled true
更改默认的telnet登录警告Banner
1.修改telnet回显信息
修改文件/etc/issue 和/etc/issue.net中的内容:
#echo " Authorized users only. All activity may be monitored and reported " > /etc/issue
#echo " Authorized users only. All activity may be monitored and reported " > /etc/issue.net
可根据实际需要修改该文件的内容,但是不要出现系统敏感信息,如redhat,suse等。
2.重启服务:
# /etc/init.d/xinetd restart
检查是否修改snmp默认团体字
vim /etc/snmp/snmpd.conf
com2sec notConfigUser default neusoft
没有目录创建逐级创建
是否限制远程登录IP范围
echo 'all:all' >>/etc/hosts.deny
/etc/init.d/xinetd restart
资源来源网络