diff options
author | fabrixxm <fabrix.xm@gmail.com> | 2017-04-07 21:07:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-07 21:07:03 +0200 |
commit | d59b35d00bf2da3eb185043bba08acb3acc7c977 (patch) | |
tree | 4a12cbfb82ffa1f88e8eb378ea39ee1a76ac5eed /scripts/tokssh | |
parent | 0ba5a19f9942b8086474d91561b9b14a87aa042e (diff) |
tokssh: shared secret support,fix no user cmd line
Diffstat (limited to 'scripts/tokssh')
-rwxr-xr-x | scripts/tokssh | 10 |
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 | ||
11 | array=( $@ ) | 12 | array=( $@ ) |
@@ -13,6 +14,13 @@ len=${#array[@]} | |||
13 | userhost=${array[$len-1]} | 14 | userhost=${array[$len-1]} |
14 | args=${array[@]:0:$len-1} | 15 | args=${array[@]:0:$len-1} |
15 | 16 | ||
17 | if [ "${array[$len-2]}" == "-s" ] | ||
18 | then | ||
19 | secret="${array[@]:$len-2:$len-1}" | ||
20 | len=$[len-2] | ||
21 | fi | ||
22 | |||
23 | |||
16 | arruserhost=(${userhost//@/ }) | 24 | arruserhost=(${userhost//@/ }) |
17 | arruserhostlen=${#arruserhost[@]} | 25 | arruserhostlen=${#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 |
25 | else | 33 | else |
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 |
28 | fi | 36 | fi |
29 | 37 | ||