Browse Source

ssh via tor on Arch

Bob Mottram 8 years ago
parent
commit
c0983fbc4a
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      src/freedombone-client

+ 9
- 3
src/freedombone-client View File

@@ -109,7 +109,7 @@ function ssh_remove_small_moduli {
109 109
 
110 110
 function configure_ssh_client {
111 111
     if [ -f /usr/bin/pacman ]; then
112
-        sudo pacman -S proxytunnel
112
+        sudo pacman --noconfirm -S openbsd-netcat
113 113
     else
114 114
         sudo apt-get -y install tor connect-proxy
115 115
     fi
@@ -162,10 +162,16 @@ function configure_ssh_client {
162 162
     echo 'Host *.onion' > ~/.ssh/config
163 163
     echo '  ServerAliveInterval 60' >> ~/.ssh/config
164 164
     echo '  ServerAliveCountMax 3' >> ~/.ssh/config
165
+
166
+    proxycmd="connect -R remote -5 -S 127.0.0.1:9050 %h %p"
167
+    if [ -f /usr/bin/pacman ]; then
168
+        proxycmd="/usr/bin/nc -X 5 -x 127.0.0.1:9050 %h %p"
169
+    fi
170
+
165 171
     if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then
166
-        echo "  ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'" >> ~/.ssh/config
172
+        echo "  ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; $proxycmd'" >> ~/.ssh/config
167 173
     else
168
-        echo "  ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config
174
+        echo "  ProxyCommand $proxycmd" >> ~/.ssh/config
169 175
     fi
170 176
     echo 'Host *' >> ~/.ssh/config
171 177
     echo '  ServerAliveInterval 60' >> ~/.ssh/config