帐号安全检查脚本
时间:2009-08-25 来源:bbzsxjj
#!/bin/sh
#查系统手工建的帐号,有SHELL权限的
cat /etc/passwd|awk -F : '{print $1"\t"$3"\t"$7}'|grep -E -v "/bin/false|bin/sync|nologin" >/tmp/bashuser.txt
cat /tmp/bashuser.txt |awk '{print $2}'>/tmp/bashtmp.txt
for i in `cat /tmp/bashtmp.txt`
do
if [ ${i} -gt 500 ]
then
#echo ${i}
cat /tmp/bashuser.txt |grep ${i}|awk '{print $1"\t"$2"\t"$3}' >>/tmp/users.txt
fi
done;
rm /tmp/bashuser.txt
rm /tmp/bashtmp.txt
echo "view /tmp/users.txt !"
#查系统手工建的帐号,有SHELL权限的
cat /etc/passwd|awk -F : '{print $1"\t"$3"\t"$7}'|grep -E -v "/bin/false|bin/sync|nologin" >/tmp/bashuser.txt
cat /tmp/bashuser.txt |awk '{print $2}'>/tmp/bashtmp.txt
for i in `cat /tmp/bashtmp.txt`
do
if [ ${i} -gt 500 ]
then
#echo ${i}
cat /tmp/bashuser.txt |grep ${i}|awk '{print $1"\t"$2"\t"$3}' >>/tmp/users.txt
fi
done;
rm /tmp/bashuser.txt
rm /tmp/bashtmp.txt
echo "view /tmp/users.txt !"
相关阅读 更多 +