blob: d73923b9cdb318663d61eb5c3d2235bd551e856a [file] [log] [blame]
Darren Tucker05b5e512013-05-17 20:41:07 +10001# $OpenBSD: login-timeout.sh,v 1.5 2013/05/17 10:23:52 dtucker Exp $
Darren Tucker017fd612004-02-29 20:30:17 +11002# Placed in the Public Domain.
3
4tid="connect after login grace timeout"
5
6trace "test login grace with privsep"
7echo "LoginGraceTime 10s" >> $OBJ/sshd_config
8echo "MaxStartups 1" >> $OBJ/sshd_config
9start_sshd
10
Darren Tucker894823e2005-03-07 18:34:04 +110011(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 &
Darren Tucker017fd612004-02-29 20:30:17 +110012sleep 15
13${SSH} -F $OBJ/ssh_config somehost true
14if [ $? -ne 0 ]; then
15 fail "ssh connect after login grace timeout failed with privsep"
16fi
17
Tim Rice722b8d12010-08-12 09:43:13 -070018$SUDO kill `$SUDO cat $PIDFILE`
Darren Tucker017fd612004-02-29 20:30:17 +110019
20trace "test login grace without privsep"
Tim Ricef45eff22004-03-07 10:40:01 -080021echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config
Darren Tucker017fd612004-02-29 20:30:17 +110022start_sshd
23
Darren Tucker894823e2005-03-07 18:34:04 +110024(echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 &
Darren Tucker017fd612004-02-29 20:30:17 +110025sleep 15
26${SSH} -F $OBJ/ssh_config somehost true
27if [ $? -ne 0 ]; then
28 fail "ssh connect after login grace timeout failed without privsep"
29fi