From c0983fbc4a91e9adf1f15999d7cc66d07825fdfb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 9 Oct 2016 19:10:36 +0100 Subject: [PATCH] ssh via tor on Arch --- src/freedombone-client | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/freedombone-client b/src/freedombone-client index 2a95f96a..862e433d 100755 --- a/src/freedombone-client +++ b/src/freedombone-client @@ -109,7 +109,7 @@ function ssh_remove_small_moduli { function configure_ssh_client { if [ -f /usr/bin/pacman ]; then - sudo pacman -S proxytunnel + sudo pacman --noconfirm -S openbsd-netcat else sudo apt-get -y install tor connect-proxy fi @@ -162,10 +162,16 @@ function configure_ssh_client { echo 'Host *.onion' > ~/.ssh/config echo ' ServerAliveInterval 60' >> ~/.ssh/config echo ' ServerAliveCountMax 3' >> ~/.ssh/config + + proxycmd="connect -R remote -5 -S 127.0.0.1:9050 %h %p" + if [ -f /usr/bin/pacman ]; then + proxycmd="/usr/bin/nc -X 5 -x 127.0.0.1:9050 %h %p" + fi + if [[ $ENABLE_MONKEYSPHERE == $'yes' || $ENABLE_MONKEYSPHERE == $'y' ]]; then - 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 + echo " ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; $proxycmd'" >> ~/.ssh/config else - echo " ProxyCommand connect -R remote -5 -S 127.0.0.1:9050 %h %p" >> ~/.ssh/config + echo " ProxyCommand $proxycmd" >> ~/.ssh/config fi echo 'Host *' >> ~/.ssh/config echo ' ServerAliveInterval 60' >> ~/.ssh/config