浏览代码

Improve ssh client config

Bob Mottram 9 年前
父节点
当前提交
5be82ed463
共有 1 个文件被更改,包括 11 次插入8 次删除
  1. 11
    8
      src/freedombone-client

+ 11
- 8
src/freedombone-client 查看文件

@@ -99,14 +99,17 @@ function configure_ssh_client {
99 99
 
100 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 114
 	echo ''
112 115
 	echo $'Copy the following into a file called /home/username/.ssh/authorized_keys on the Freedombone server'