Darren Tucker | 894823e | 2005-03-07 18:34:04 +1100 | [diff] [blame^] | 1 | # $OpenBSD: login-timeout.sh,v 1.4 2005/02/27 23:13:36 djm Exp $ |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="connect after login grace timeout" |
| 5 | |
| 6 | trace "test login grace with privsep" |
| 7 | echo "LoginGraceTime 10s" >> $OBJ/sshd_config |
| 8 | echo "MaxStartups 1" >> $OBJ/sshd_config |
| 9 | start_sshd |
| 10 | |
Darren Tucker | 894823e | 2005-03-07 18:34:04 +1100 | [diff] [blame^] | 11 | (echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 & |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 12 | sleep 15 |
| 13 | ${SSH} -F $OBJ/ssh_config somehost true |
| 14 | if [ $? -ne 0 ]; then |
| 15 | fail "ssh connect after login grace timeout failed with privsep" |
| 16 | fi |
| 17 | |
Darren Tucker | 9929d1f | 2004-04-19 22:01:37 +1000 | [diff] [blame] | 18 | $SUDO kill `cat $PIDFILE` |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 19 | |
| 20 | trace "test login grace without privsep" |
Tim Rice | f45eff2 | 2004-03-07 10:40:01 -0800 | [diff] [blame] | 21 | echo "UsePrivilegeSeparation no" >> $OBJ/sshd_config |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 22 | start_sshd |
| 23 | |
Darren Tucker | 894823e | 2005-03-07 18:34:04 +1100 | [diff] [blame^] | 24 | (echo SSH-2.0-fake; sleep 60) | telnet 127.0.0.1 ${PORT} >/dev/null 2>&1 & |
Darren Tucker | 017fd61 | 2004-02-29 20:30:17 +1100 | [diff] [blame] | 25 | sleep 15 |
| 26 | ${SSH} -F $OBJ/ssh_config somehost true |
| 27 | if [ $? -ne 0 ]; then |
| 28 | fail "ssh connect after login grace timeout failed without privsep" |
| 29 | fi |