HEX
Server: nginx/1.16.1
System: Linux ecs-04358622 4.19.90-2107.6.0.0100.oe1.bclinux.x86_64 #1 SMP Wed Dec 1 19:59:44 CST 2021 x86_64
User: nginx (994)
PHP: 8.0.0
Disabled: NONE
Upload Files
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