浏览代码

Option to verify the ssh server public key

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

+ 13
- 2
src/freedombone-client 查看文件

@@ -114,7 +114,7 @@ function configure_ssh_client {
114 114
     if [ -f /usr/bin/pacman ]; then
115 115
         sudo pacman --noconfirm -S openbsd-netcat
116 116
     else
117
-        sudo apt-get -yq install tor connect-proxy
117
+        sudo apt-get -yq install tor connect-proxy vim-common
118 118
     fi
119 119
 
120 120
     #sudo sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
@@ -277,7 +277,14 @@ function setup_avahi_client {
277 277
     fi
278 278
 }
279 279
 
280
-while [[ $# > 1 ]]
280
+function verify_ssh_server_key {
281
+    ssh -o VisualHostKey=yes -o FingerprintHash=sha256 ${PROJECT_NAME}.local -p 2222 &
282
+    pid=$!
283
+    sleep 15
284
+    kill ${pid}
285
+}
286
+
287
+while [[ $# > 0 ]]
281 288
 do
282 289
     key="$1"
283 290
 
@@ -297,6 +304,10 @@ do
297 304
             shift
298 305
             SETUP_CLIENT_APP_NAME=${1}
299 306
             ;;
307
+        -v|--verify|--verifykeys)
308
+            verify_ssh_server_key
309
+            exit 0
310
+            ;;
300 311
         -m|--mesh)
301 312
             shift
302 313
             MESH_CLIENT_INSTALL=${1}