diff options
author | Andrew Cady <d@jerkface.net> | 2020-08-20 06:45:08 -0400 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2020-08-20 16:29:56 -0400 |
commit | d2345a8a2f28aed7722cbd76cc3f03543db90bbd (patch) | |
tree | 847d09578c86d2b9752bd033189e6928d642943e | |
parent | 5d1bce667f97244718bbeaff42bade637782c6ba (diff) |
tokssh: persist client key if ~/.tuntox/persist/ exists
-rwxr-xr-x | scripts/tokssh | 22 |
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 | ||
25 | files: | 25 | files: |
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) | ||
29 | EOF | 37 | EOF |
30 | } | 38 | } |
31 | 39 | ||
@@ -84,4 +92,10 @@ if [ -f ~/.tuntox/hosts ]; then | |||
84 | done < ~/.tuntox/hosts | 92 | done < ~/.tuntox/hosts |
85 | fi | 93 | fi |
86 | 94 | ||
87 | ssh -o ProxyCommand="tuntox -i $toxid -W 127.0.0.1:%p $secret" $args ${user}${hostname} | 95 | if [ -d ~/.tuntox/persist ]; then |
96 | persist='-C ~/.tuntox/persist' | ||
97 | else | ||
98 | persist= | ||
99 | fi | ||
100 | |||
101 | ssh -o ProxyCommand="tuntox $persist -i $toxid -W 127.0.0.1:%p $secret" $args ${user}${hostname} | ||