블로그 이미지
문슐랭 upip57@naver.com
진짜귀찮음

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
  • total
  • today
  • yesterday
2018. 5. 17. 13:44 프로그래밍/스크립트

[주요통신기반시설] 1.5 root UID 0 금지 





[주요통신기반시설] 1.6 root 계정 관리 





[주요통신기반시설] 1.5~6 root 계정 관리 소스 코드 


#!/bin/bash



########## 1.5 root_UID ##########


while read line

do

passwd_ID=`echo $line | awk -F: '{print $1}'`

passwd_uid=`echo $line | awk -F: '{print $3}'`



if [ ${passwd_ID} = "root" ];

then

echo "root pass"

else

if [ ${passwd_uid} -eq 0 ];

then

echo $passwd_ID " uid is " $passwd_uid " Danger!!"

else

echo $passwd_ID " uid is " $passwd_uid " safe!!"

fi

fi

  

done < /etc/passwd



########## 1.6 root_su ##########


echo ""

echo "###### 1.6 root su ######"


su_check=`cat /etc/pam.d/su | grep "#auth"`


if [ -z "${su_check}" ];

then

echo "Clear"

else

echo "Danger you need del '#'"

echo $su_sheck


fi



파일 다운로드


1.5~6_root_Uid_su.sh



posted by 진짜귀찮음