70b09dc5067eb781fb3dd4806cf7a65b219bffd2
[feisty_meow.git] / scripts / security / khandroma_tunnels.sh
1 #!/bin/bash
2 # tunnels to the khandroma machine for vnc access to the win7 box and for the jenkins
3 # server.
4
5 soundfile=$FEISTY_MEOW_DIR/database/sounds/my_mind_is_going.wav
6 if [ ! -z "$1" ]; then
7   soundfile=$1
8 fi
9
10 while true; do
11   echo Connecting jenkins and vms at khandroma.
12   ssh -i $HOME/.ssh/id_dsa_fred -2 -N -v -L "*:5908:localhost:5908" -L "*:4040:localhost:8080" fred@khandroma.cs.virginia.edu &>~/.tmp/zz_tunnel_khandro_jenkins_vnc.log &
13   bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh $soundfile &>/dev/null </dev/null &
14   echo "Got dumped from tunnels; re-establishing connection."
15   echo "Note: if you're being asked for a password, you haven't set up an RSA key yet."
16   sleep 14
17 done
18
19 #-L 8028:localhost:3128 
20
21 #-L 8043:localhost:443 
22
23 # ports sometimes used:
24 #     25 is the sendmail tunnel.
25 #   3128 is the squid proxy server.
26 #    443 is the https version of squid.
27
28 # ssh flags in use sometimes:
29 #   -f   go into the background once connected.
30 #   -2   enforce ssh version 2.
31 #   -N   don't execute any command; just forward data between the ports.
32 #   -L   (port:host:hostport) connect the local machine's "port" to the
33 #        remote port "hostport" on the "host" specified.  the local "port"
34 #        becomes an alias for the remote port.  note that the connection
35 #        being made to host and hostport is from the perspective of the ssh
36 #        server, not the local host.
37
38