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

32 lines
957 B
Bash
Raw Normal View History

2014-03-22 15:23:38 +00:00
# $OpenBSD: login-timeout.sh,v 1.6 2014/02/27 20:04:16 djm 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
2005-06-05 15:40:50 +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
fail "ssh connect after login grace timeout failed with privsep"
fi
2010-11-08 10:45:44 +00:00
$SUDO kill `$SUDO cat $PIDFILE`
2004-04-20 09:35:04 +00:00
trace "test login grace without privsep"
echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config
start_sshd
2005-06-05 15:40:50 +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
fail "ssh connect after login grace timeout failed without privsep"
fi