File: //opt/BCLinux/bse/secure_check/c13_sshProtocol
#!/bin/sh
#=======================================================
InsertSection "check the ssh protocol"
#-----------------Check the Protole to 2.0----------------
IS_EXIST=`egrep -v '^#|^$' /etc/ssh/sshd_config | grep 'Protocol' | wc -l`
if [ ${IS_EXIST} -eq 0 ] ; then
#echo " " >> /etc/ssh/sshd_config
#echo "Protocol 2" >> /etc/ssh/sshd_config
echo "c13" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C13_01: $(loadtext TXT_WRN_C13_01)"
logtext "Suggestion: $(loadtext TXT_SUG_C13)"
Display --indent 2 --text "- No ssh protocol config set... " --result WARNING --color RED
AddHP 0 1
else
if [ $(egrep -v '^#|^$' /etc/ssh/sshd_config | grep 'Protocol' | grep 2 | wc -l) -eq 0 ];then
echo "c13" >> $RESULT_FILE
echo "" >> $RESULT_FILE
logtext "WRN_C13_02: $(loadtext TXT_WRN_C13_02)"
logtext "Suggestion: $(loadtext TXT_SUG_C13)"
Display --indent 2 --text "- Wrong ssh protocol config set... " --result WARNING --color RED
AddHP 0 1
else
logtext "Has ssh protocol set, checking ok"
Display --indent 2 --text "- Check the ssh protocol... " --result OK --color GREEN
AddHP 1 1
fi
fi