blob: 023ba73678dd1d2920adce52946e9a563b88e674 [file] [log] [blame]
Damien Millerd0b69fe2014-05-15 15:08:19 +10001# $OpenBSD: proxy-connect.sh,v 1.7 2014/05/03 18:46:14 dtucker Exp $
Damien Miller38cd4352002-05-01 13:17:33 +10002# Placed in the Public Domain.
3
4tid="proxy connect"
5
Damien Millerd0b69fe2014-05-15 15:08:19 +10006mv $OBJ/sshd_proxy $OBJ/sshd_proxy.orig
7
8for ps in no yes; do
9 cp $OBJ/sshd_proxy.orig $OBJ/sshd_proxy
10 echo "UsePrivilegeSeparation $ps" >> $OBJ/sshd_proxy
11
12 for p in 1 2; do
13 for c in no yes; do
14 verbose "plain username protocol $p privsep=$ps comp=$c"
15 opts="-$p -oCompression=$c -F $OBJ/ssh_proxy"
16 SSH_CONNECTION=`${SSH} $opts 999.999.999.999 'echo $SSH_CONNECTION'`
Damien Miller38cd4352002-05-01 13:17:33 +100017 if [ $? -ne 0 ]; then
Damien Millerd0b69fe2014-05-15 15:08:19 +100018 fail "ssh proxyconnect protocol $p privsep=$ps comp=$c failed"
Damien Miller8b9cde72003-01-22 17:53:16 +110019 fi
20 if [ "$SSH_CONNECTION" != "UNKNOWN 65535 UNKNOWN 65535" ]; then
Damien Millerd0b69fe2014-05-15 15:08:19 +100021 fail "bad SSH_CONNECTION protocol $p privsep=$ps comp=$c"
Damien Miller8b9cde72003-01-22 17:53:16 +110022 fi
Damien Millerd0b69fe2014-05-15 15:08:19 +100023 done
24 done
Damien Miller38cd4352002-05-01 13:17:33 +100025done
Darren Tucker712de4d2013-05-17 09:07:12 +100026
Darren Tucker712de4d2013-05-17 09:07:12 +100027for p in 1 2; do
Damien Millerd0b69fe2014-05-15 15:08:19 +100028 verbose "username with style protocol $p"
Darren Tucker712de4d2013-05-17 09:07:12 +100029 ${SSH} -$p -F $OBJ/ssh_proxy ${USER}:style@999.999.999.999 true || \
30 fail "ssh proxyconnect protocol $p failed"
31done