1# $OpenBSD: login-timeout.sh,v 1.10 2021/09/30 05:20:08 dtucker Exp $ 2# Placed in the Public Domain. 3 4tid="connect after login grace timeout" 5 6trace "test login grace time" 7cp $OBJ/sshd_config $OBJ/sshd_config.orig 8grep -vi LoginGraceTime $OBJ/sshd_config.orig > $OBJ/sshd_config 9echo "LoginGraceTime 10s" >> $OBJ/sshd_config 10echo "MaxStartups 1" >> $OBJ/sshd_config 11start_sshd 12 13(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 & 14sleep 15 15${SSH} -F $OBJ/ssh_config somehost true 16if [ $? -ne 0 ]; then 17 fail "ssh connect after login grace timeout failed" 18fi 19