#!/bin/bash
#SSH to antarctica via ocean.

#Outer tunnel. [Note that we compress here (-C) but that this is sufficient for all subsequent nested connections.]
if ssh -C -f -L 2222:antarctica:22 tux@ocean sleep 20; then
	#1)  SSH through the forwarded-tunnel.     [NB: avoid using .ssh/known_hosts for localhost, or it will cache the key under the wrong name]
 	#ssh -o UserKnownHostsFile=/dev/null -p 2222 tux@localhost
	#2)  OR, GUI drag and drop with konqueror,fish through the tunnel:
	konqueror fish://tux@localhost:2222
else
        echo "Error: cannot reach ocean" ; exit 1
fi
exit $?
