freebsd-dev/regress/login-timeout.sh

33 lines
947 B
Bash
Raw Normal View History

2017-01-31 12:33:47 +00:00
# $OpenBSD: login-timeout.sh,v 1.8 2016/12/16 01:06:27 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
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
2017-01-31 12:33:47 +00:00
stop_sshd
2004-04-20 09:35:04 +00:00
trace "test login grace without privsep"
echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config
start_sshd
2015-01-05 16:09:55 +00:00
sleep 1
2004-04-20 09:35:04 +00:00
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