쉘 스크립트 소스
#!/bin/bash
######## 1.2 password ##########
max_days=`grep "^PASS_MAX_DAYS" /etc/login.defs | awk '{print $2}'`
min_days=`grep "^PASS_MAX_DAYS" /etc/login.defs | awk '{print $2}'`
min_len=`grep "^PASS_MIN_LEN" /etc/login.defs | awk '{print $2}'`
echo "Max days " $max_days
echo "Min days " $min_days
echo "Min len " $min_len
####### 1.3 passowrd ###########
password_deny=`grep deny= /etc/pam.d/system-auth | awk '{print $4}' | awk -F = '{print $2}'`
if [ -z "`grep deny= /etc/pam.d/system-auth`" ];
then
echo "Danger_no login deny time" 2>&1
else
echo "Deny time : "$password_deny " in Login" 2>&1
fi
##### 1.4 password_protect ###########
if [ -z "cat /etc/passwd | grep root | awk -F: '{print $2}' | sed -n '1p' = x" ];
then
echo "Danger"
else
if test -r /etc/shadow
then
echo "shadow file Ok!"
else
echo "No shadow File Danger!!"
fi
fi
'프로그래밍 > 스크립트' 카테고리의 다른 글
[주요통신기반시설] 1.10~11 계정 관리 (0) | 2018.05.17 |
---|---|
[주요통신기반시설] 1.5~6 root 계정 관리 (0) | 2018.05.17 |
[주요통신기반시설] 1.1 root 계정 원격 접속제한_스크립트 (0) | 2018.05.09 |