freebsd-dev/crypto/openssh/regress/login-timeout.sh

19 lines
588 B
Bash
Raw Normal View History

2018-05-06 12:24:45 +00:00
# $OpenBSD: login-timeout.sh,v 1.9 2017/08/07 00:53:51 dtucker Exp $
2004-04-20 09:35:04 +00:00
# Placed in the Public Domain.
tid="connect after login grace timeout"
trace "test login grace with privsep"
2014-03-22 15:23:38 +00:00
cp $OBJ/sshd_config $OBJ/sshd_config.orig
grep -vi LoginGraceTime $OBJ/sshd_config.orig > $OBJ/sshd_config
2004-04-20 09:35:04 +00:00
echo "LoginGraceTime 10s" >> $OBJ/sshd_config
echo "MaxStartups 1" >> $OBJ/sshd_config
start_sshd
2018-05-06 12:24:45 +00:00
(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 &
2004-04-20 09:35:04 +00:00
sleep 15
${SSH} -F $OBJ/ssh_config somehost true
if [ $? -ne 0 ]; then
2018-05-06 12:24:45 +00:00
fail "ssh connect after login grace timeout failed"
2004-04-20 09:35:04 +00:00
fi