summaryrefslogtreecommitdiff
path: root/scripts/tokssh
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2017-04-07 21:07:03 +0200
committerGitHub <noreply@github.com>2017-04-07 21:07:03 +0200
commitd59b35d00bf2da3eb185043bba08acb3acc7c977 (patch)
tree4a12cbfb82ffa1f88e8eb378ea39ee1a76ac5eed /scripts/tokssh
parent0ba5a19f9942b8086474d91561b9b14a87aa042e (diff)
tokssh: shared secret support,fix no user cmd line
Diffstat (limited to 'scripts/tokssh')
-rwxr-xr-xscripts/tokssh10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/tokssh b/scripts/tokssh
index 9d219bb..11cf858 100755
--- a/scripts/tokssh
+++ b/scripts/tokssh
@@ -6,6 +6,7 @@
6# tokssh user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 6# tokssh user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054
7# tokssh 5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 7# tokssh 5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054
8# tokssh -p 2222 -o ForwardAgent=yes user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 8# tokssh -p 2222 -o ForwardAgent=yes user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054
9# tokssh user@5A40C3443ABD6E1DDEE682E83F84A4D556C24C22D2230DCC141A4723C123473C171A4D9C4054 -s TuNToXSeCreT
9# 10#
10 11
11array=( $@ ) 12array=( $@ )
@@ -13,6 +14,13 @@ len=${#array[@]}
13userhost=${array[$len-1]} 14userhost=${array[$len-1]}
14args=${array[@]:0:$len-1} 15args=${array[@]:0:$len-1}
15 16
17if [ "${array[$len-2]}" == "-s" ]
18then
19 secret="${array[@]:$len-2:$len-1}"
20 len=$[len-2]
21fi
22
23
16arruserhost=(${userhost//@/ }) 24arruserhost=(${userhost//@/ })
17arruserhostlen=${#arruserhost[@]} 25arruserhostlen=${#arruserhost[@]}
18 26
@@ -24,6 +32,6 @@ then
24 ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p" $args $user@localhost 32 ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p" $args $user@localhost
25else 33else
26# last argument is just toxid 34# last argument is just toxid
27 ssh -o ProxyCommand="tuntox -i $toxid -P 127.0.0.1:%p" $args localhost 35 ssh -o ProxyCommand="tuntox -i $userhost -P 127.0.0.1:%p" $args localhost
28fi 36fi
29 37