summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-08-20 06:45:08 -0400
committerAndrew Cady <d@jerkface.net>2020-08-20 16:29:56 -0400
commitd2345a8a2f28aed7722cbd76cc3f03543db90bbd (patch)
tree847d09578c86d2b9752bd033189e6928d642943e
parent5d1bce667f97244718bbeaff42bade637782c6ba (diff)
tokssh: persist client key if ~/.tuntox/persist/ exists
-rwxr-xr-xscripts/tokssh22
1 files changed, 18 insertions, 4 deletions
diff --git a/scripts/tokssh b/scripts/tokssh
index eeddb21..8169bdd 100755
--- a/scripts/tokssh
+++ b/scripts/tokssh
@@ -23,9 +23,17 @@ examples:
23 tokssh user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 -s TuNToXSeCreT 23 tokssh user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 -s TuNToXSeCreT
24 24
25files: 25files:
26 ~/.tuntox/hosts maps hostname to ToxID and optional secret. 26 ~/.tuntox/persist/
27 format is 27
28 hostname ToxID secret(optional) 28 If directory exists, then read & store a persistent secret key/TOXID within.
29
30 ~/.tuntox/hosts
31
32 Maps hostname to ToxID and optional secret.
33
34 format is:
35
36 hostname ToxID secret(optional)
29EOF 37EOF
30} 38}
31 39
@@ -84,4 +92,10 @@ if [ -f ~/.tuntox/hosts ]; then
84 done < ~/.tuntox/hosts 92 done < ~/.tuntox/hosts
85fi 93fi
86 94
87ssh -o ProxyCommand="tuntox -i $toxid -W 127.0.0.1:%p $secret" $args ${user}${hostname} 95if [ -d ~/.tuntox/persist ]; then
96 persist='-C ~/.tuntox/persist'
97else
98 persist=
99fi
100
101ssh -o ProxyCommand="tuntox $persist -i $toxid -W 127.0.0.1:%p $secret" $args ${user}${hostname}