summaryrefslogtreecommitdiff
path: root/localautossh
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2007-08-07 16:34:50 +0000
committerJonas Smedegaard <dr@jones.dk>2007-08-07 16:34:50 +0000
commitf3af6e6633da2f5dd1a4c0494721f882554aeee4 (patch)
tree26bdba11face4d2fbcf7f9c7f762b18a9d46ac7c /localautossh
parent13195f6437d548a220c81ff8d3ba1323c4a29412 (diff)
New helper script for autossh.
Diffstat (limited to 'localautossh')
-rwxr-xr-xlocalautossh29
1 files changed, 29 insertions, 0 deletions
diff --git a/localautossh b/localautossh
new file mode 100755
index 0000000..92aa7a4
--- /dev/null
+++ b/localautossh
@@ -0,0 +1,29 @@
+#!/bin/sh
+#
+# Example script to start up tunnel with autossh.
+#
+# This script will tunnel 2200 from the remote host
+# to 22 on the local host. On remote host do:
+# ssh -p 2200 localhost
+#
+# $Id: localautossh,v 1.1 2007-08-07 16:34:50 jonas Exp $
+#
+
+if [ -z "$SSH_ASKPASS" ]; then
+ export SSH_ASKPASS="ssh-askpass"
+fi
+
+if [ "X$SSH_AUTH_SOCK" = "X" ]; then
+ eval `ssh-agent -s`
+ ssh-add $HOME/.ssh/id_rsa
+fi
+
+#AUTOSSH_POLL=600
+#AUTOSSH_PORT=20000
+#AUTOSSH_GATETIME=30
+#AUTOSSH_LOGFILE=$HOST.log
+#AUTOSSH_DEBUG=yes
+#AUTOSSH_PATH=/usr/local/bin/ssh
+export AUTOSSH_POLL AUTOSSH_LOGFILE AUTOSSH_DEBUG AUTOSSH_PATH AUTOSSH_GATETIME AUTOSSH_PORT
+
+autossh -2 -fN -M 20000 -R 2200:localhost:22 "$1"