File: //opt/BCLinux/bse/secure_set/s12_sshGssapi
#!/bin/sh
#=====================================================================
InsertSection "Set the gssapi..."
if [ $SET_SSH_GSSAPI -eq 1 ]; then
cp -np /etc/ssh/sshd_config /etc/ssh/sshd_config_bak
#-----------------set the GSSAPI----------------
IS_EXIST=`egrep -v '^#|^$' /etc/ssh/sshd_config | grep '^GSSAPIAuthentication' |wc -l`
if [ "${IS_EXIST}" -gt "0" ] ; then
sed -i 's/^GSSAPIAuthentication.*/GSSAPIAuthentication no/' /etc/ssh/sshd_config
else
echo " " >> /etc/ssh/sshd_config
echo "GSSAPIAuthentication no" >> /etc/ssh/sshd_config
fi
IS_EXIST=`egrep -v '^#|^$' /etc/ssh/sshd_config | grep '^GSSAPIAuthentication' |wc -l`
if [ ${IS_EXIST} -gt 0 ] ; then
if [[ $(egrep -v '^#|^$' /etc/ssh/sshd_config | grep '^GSSAPIAuthentication' | cut -d ' ' -f 2) != "no" ]];then
logtext "set the ssh gssapi failed, wrong setting"
Display --indent 2 --text "- Set the ssh gssapi... " --result FAILED --color RED
else
logtext "set the ssh cipher successfully"
Display --indent 2 --text "- Set the ssh cipher... " --result FINISHED --color GREEN
fi
else
logtext "set the ssh gssapi failed,no set option"
Display --indent 2 --text "- Set the ssh gssapi... " --result FAILED --color RED
fi
#logtext "restart the sshd service..."
#systemctl restart sshd.service
else
Display --indent 2 --text "- Skip set ssh gssapi due to config file... " --result SKIPPING --color YELLOW
fi