ssh via tor on Arch

This commit is contained in:
Bob Mottram 2016-10-09 19:10:36 +01:00
parent e8a6d8fdd7
commit c0983fbc4a
1 changed files with 9 additions and 3 deletions

View File

@ -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