sed -i 's/^uucp/#;/g' /etc/passwd sed -i 's/^nuucp/#;/g' /etc/passwd sed -i 's/^lp/#;/g' /etc/passwd sed -i 's/^news/#;/g' /etc/passwd sed -i 's/^games/#a;/g' /etc/passwd
sed -i 's/^uucp/#;/g' /etc/shadow sed -i 's/^nuucp/#;/g' /etc/shadow sed -i 's/^lp/#;/g' /etc/shadow sed -i 's/^news/#;/g' /etc/shadow sed -i 's/^games/#;/g' /etc/shadow
sed -i 's/^uucp/#;/g' /etc/group sed -i 's/^nuucp/#;/g' /etc/group sed -i 's/^lp/#;/g' /etc/group sed -i 's/^news/#;/g' /etc/group sed -i 's/^games/#;/g' /etc/group
###############################################
echo "正在修改禁止管理员远程登录..." sed -i 's/^#PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config
###############################################
echo "正在修改系统命令行保存条目..." sleep 1 cat /etc/profile |grep ^HISTSIZE > /dev/null if [ $? == 0 ];then sed -i 's/^HISTSIZE=[0-9]\{1,4\}/HISTSIZE=30/g' /etc/profile fi cat /etc/profile |grep ^HISTFILESIZE > /dev/null if [ $? == 1 ];then echo "HISTFILESIZE=30" >> /etc/profile fi
###############################################
echo "正在修改系统启动级别..." sleep 1 init=`cat /etc/inittab |grep ^id |cut -d ":" -f 2` if [ $init != 3 ];then sed -i '/^id/s/'"${init}"'/3/g' /etc/inittab fi