Browse Source

Option to verify the ssh server public key

Bob Mottram 8 years ago
parent
commit
413c6a40d3
1 changed files with 13 additions and 2 deletions
  1. 13
    2
      src/freedombone-client

+ 13
- 2
src/freedombone-client View File

114
     if [ -f /usr/bin/pacman ]; then
114
     if [ -f /usr/bin/pacman ]; then
115
         sudo pacman --noconfirm -S openbsd-netcat
115
         sudo pacman --noconfirm -S openbsd-netcat
116
     else
116
     else
117
-        sudo apt-get -yq install tor connect-proxy
117
+        sudo apt-get -yq install tor connect-proxy vim-common
118
     fi
118
     fi
119
 
119
 
120
     #sudo sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
120
     #sudo sed -i 's/#   PasswordAuthentication.*/   PasswordAuthentication no/g' /etc/ssh/ssh_config
277
     fi
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
 do
288
 do
282
     key="$1"
289
     key="$1"
283
 
290
 
297
             shift
304
             shift
298
             SETUP_CLIENT_APP_NAME=${1}
305
             SETUP_CLIENT_APP_NAME=${1}
299
             ;;
306
             ;;
307
+        -v|--verify|--verifykeys)
308
+            verify_ssh_server_key
309
+            exit 0
310
+            ;;
300
         -m|--mesh)
311
         -m|--mesh)
301
             shift
312
             shift
302
             MESH_CLIENT_INSTALL=${1}
313
             MESH_CLIENT_INSTALL=${1}