Browse Source

Improve ssh client config

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

+ 11
- 8
src/freedombone-client View File

99
 
99
 
100
 	ssh_remove_small_moduli
100
 	ssh_remove_small_moduli
101
 
101
 
102
-	echo 'Host *.onion
103
-	ServerAliveInterval 60
104
-	ServerAliveCountMax 3
105
-	ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h %p ; connect -R remote -5 -S 127.0.0.1:9050 %h %p'
106
-Host *
107
-	ServerAliveInterval 60
108
-	ServerAliveCountMax 3
109
-	ProxyCommand monkeysphere ssh-proxycommand %h %p' > ~/.ssh/config
102
+	if [ ! -d ~/.ssh ]; then
103
+		mkdir ~/.ssh
104
+	fi
105
+	echo 'Host *.onion' > ~/.ssh/config
106
+	echo '  ServerAliveInterval 60' >> ~/.ssh/config
107
+	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
108
+	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
109
+	echo 'Host *' >> ~/.ssh/config
110
+	echo '  ServerAliveInterval 60' >> ~/.ssh/config
111
+	echo '  ServerAliveCountMax 3' >> ~/.ssh/config
112
+	echo '  ProxyCommand monkeysphere ssh-proxycommand %h %p' >> ~/.ssh/config
110
 
113
 
111
 	echo ''
114
 	echo ''
112
 	echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'
115
 	echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'