2016-12-16 02:06:27 +01:00
|
|
|
# $OpenBSD: login-timeout.sh,v 1.8 2016/12/16 01:06:27 dtucker Exp $
|
2004-02-29 10:30:17 +01:00
|
|
|
# Placed in the Public Domain.
|
|
|
|
|
|
|
|
tid="connect after login grace timeout"
|
|
|
|
|
|
|
|
trace "test login grace with privsep"
|
2014-02-28 00:24:11 +01:00
|
|
|
cp $OBJ/sshd_config $OBJ/sshd_config.orig
|
|
|
|
grep -vi LoginGraceTime $OBJ/sshd_config.orig > $OBJ/sshd_config
|
2004-02-29 10:30:17 +01:00
|
|
|
echo "LoginGraceTime 10s" >> $OBJ/sshd_config
|
|
|
|
echo "MaxStartups 1" >> $OBJ/sshd_config
|
|
|
|
start_sshd
|
|
|
|
|
2005-03-07 08:34:04 +01:00
|
|
|
(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 &
|
2004-02-29 10:30:17 +01: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
|
|
|
|
|
2016-12-16 02:06:27 +01:00
|
|
|
stop_sshd
|
2004-02-29 10:30:17 +01:00
|
|
|
|
|
|
|
trace "test login grace without privsep"
|
2004-03-07 19:40:01 +01:00
|
|
|
echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config
|
2004-02-29 10:30:17 +01:00
|
|
|
start_sshd
|
2014-05-15 07:07:33 +02:00
|
|
|
sleep 1
|
2004-02-29 10:30:17 +01:00
|
|
|
|
2005-03-07 08:34:04 +01:00
|
|
|
(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 &
|
2004-02-29 10:30:17 +01: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
|