summaryrefslogtreecommitdiff
path: root/src/monkeysphere-ssh-proxycommand
diff options
context:
space:
mode:
Diffstat (limited to 'src/monkeysphere-ssh-proxycommand')
-rwxr-xr-xsrc/monkeysphere-ssh-proxycommand16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/monkeysphere-ssh-proxycommand b/src/monkeysphere-ssh-proxycommand
new file mode 100755
index 0000000..1724966
--- /dev/null
+++ b/src/monkeysphere-ssh-proxycommand
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+# MonkeySphere ssh ProxyCommand hook
+# Proxy command script to initiate a monkeysphere known_hosts update
+# before an ssh connection to host is established.
+# Can be added to ~/.ssh/config as follows:
+# ProxyCommand monkeysphere-ssh-proxycommand %h %p
+
+HOST="$1"
+PORT="$2"
+
+# update the known_hosts file for the host
+monkeysphere update-known-hosts "$HOST"
+
+# make a netcat connection to host for the ssh connection
+exec nc "$HOST" "$PORT"