Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2002 13:20:31 +1300
From:      andy@sambolian.net.nz
To:        freebsd-security@freebsd.org
Subject:   SSH proxy
Message-ID:  <1014164431.3c72ebcff08c3@webmail.sambolian.net.nz>

next in thread | raw e-mail | index | archive | help
Hi

I have a fbsd gateway at home through which I share our cable modem with my 
flatmates.  They have their own boxes on the lan and ssh to them from work.  At 
the moment we log into the gateway and from there ssh to the box we want.  I 
have made a shell script to automate this, and have set it as the default shell 
for our accounts on the gateway.  It all works well but I would like to know if 
there is a better way and also if there is a security rish with the way I have 
done it now.  Here is the script....

<!-- snip -->

#!/bin/sh
echo
echo ---------------------------------------
echo ------------ SSH Proxy ----------------
echo ---------------------------------------
echo

SSH=/usr/bin/ssh
DEFAULTUSER=`whoami`
DEFAULTHOST=`cat ~/.sshproxyhost 2> /dev/null`

echo -n Enter username [${DEFAULTUSER}]:
read USERNAME

echo -n Enter host [${DEFAULTHOST}]:
read HOSTNAME

if [ -z ${USERNAME} ]; then
        USERNAME=${DEFAULTUSER}
fi


if [ -z ${HOSTNAME} ]; then
        HOSTNAME=${DEFAULTHOST}
fi

if [ -z ${HOSTNAME} ]; then
        echo "Can not determine the hostname"
        exit 1
fi


echo ${HOSTNAME} > ~/.sshproxyhost

${SSH} -l ${USERNAME} ${HOSTNAME}

exit 0

<!-- snip -->




cheers


Andrew

-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1014164431.3c72ebcff08c3>