Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 1 | # $OpenBSD: proxy-connect.sh,v 1.7 2014/05/03 18:46:14 dtucker Exp $ |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 2 | # Placed in the Public Domain. |
| 3 | |
| 4 | tid="proxy connect" |
| 5 | |
Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 6 | mv $OBJ/sshd_proxy $OBJ/sshd_proxy.orig |
| 7 | |
| 8 | for 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 Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 17 | if [ $? -ne 0 ]; then |
Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 18 | fail "ssh proxyconnect protocol $p privsep=$ps comp=$c failed" |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 19 | fi |
| 20 | if [ "$SSH_CONNECTION" != "UNKNOWN 65535 UNKNOWN 65535" ]; then |
Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 21 | fail "bad SSH_CONNECTION protocol $p privsep=$ps comp=$c" |
Damien Miller | 8b9cde7 | 2003-01-22 17:53:16 +1100 | [diff] [blame] | 22 | fi |
Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 23 | done |
| 24 | done |
Damien Miller | 38cd435 | 2002-05-01 13:17:33 +1000 | [diff] [blame] | 25 | done |
Darren Tucker | 712de4d | 2013-05-17 09:07:12 +1000 | [diff] [blame] | 26 | |
Darren Tucker | 712de4d | 2013-05-17 09:07:12 +1000 | [diff] [blame] | 27 | for p in 1 2; do |
Damien Miller | d0b69fe | 2014-05-15 15:08:19 +1000 | [diff] [blame] | 28 | verbose "username with style protocol $p" |
Darren Tucker | 712de4d | 2013-05-17 09:07:12 +1000 | [diff] [blame] | 29 | ${SSH} -$p -F $OBJ/ssh_proxy ${USER}:style@999.999.999.999 true || \ |
| 30 | fail "ssh proxyconnect protocol $p failed" |
| 31 | done |