first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / security / start_tunnels.sh
1 #!/bin/bash
2 # this script makes a tunnel for SMTP traffic and others.  a remote ssh server
3 # is required.  this is especially useful for routing around firewalls using
4 # a web proxy like squid.  when used for SMTP, it ensures that none of the
5 # text is seen on whatever network one is on before it's sent from the remote
6 # server.
7
8 #hmmm:  none of the user info below will work for others: parameterize it.
9
10 #source $HOME/yeti/scripts/profile.sh
11
12 soundfile=$YETI_DIR/database/sounds/woouoo.wav
13 if [ ! -z "$1" ]; then
14   soundfile=$1
15 fi
16
17 while true; do
18   echo Connecting sendmail and proxy servers via zooty.
19   ssh -i $HOME/.ssh/id_dsa_fred -2 -N -v -L 14008:localhost:25 fred@zooty.koeritz.com
20   bash $SHELLDIR/multimedia/sound_play.sh $soundfile
21 #hmmm: parameterize this for the sound to be played.  doofus.
22   echo "Got dumped from tunnels; re-establishing connection."
23   echo "Note: if you're being asked for a password, you haven't set up an RSA key yet."
24   sleep 14
25 done
26
27 #-L 8028:localhost:3128 
28
29 #-L 8043:localhost:443 
30
31 # ports sometimes used:
32 #     25 is the sendmail tunnel.
33 #   3128 is the squid proxy server.
34 #    443 is the https version of squid.
35
36 # ssh flags in use sometimes:
37 #   -f   go into the background once connected.
38 #   -2   enforce ssh version 2.
39 #   -N   don't execute any command; just forward data between the ports.
40 #   -L   (port:host:hostport) connect the local machine's "port" to the
41 #        remote port "hostport" on the "host" specified.  the local "port"
42 #        becomes an alias for the remote port.  note that the connection
43 #        being made to host and hostport is from the perspective of the ssh
44 #        server, not the local host.
45
46