From 413c6a40d3d0e9a4ab175d6b7dd2d0ac98eaabec Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Nov 2016 14:56:11 +0000 Subject: [PATCH] Option to verify the ssh server public key --- src/freedombone-client | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/freedombone-client b/src/freedombone-client index 94da3d25..c6c47a9c 100755 --- a/src/freedombone-client +++ b/src/freedombone-client @@ -114,7 +114,7 @@ function configure_ssh_client { if [ -f /usr/bin/pacman ]; then sudo pacman --noconfirm -S openbsd-netcat else - sudo apt-get -yq install tor connect-proxy + sudo apt-get -yq install tor connect-proxy vim-common fi #sudo sed -i 's/# PasswordAuthentication.*/ PasswordAuthentication no/g' /etc/ssh/ssh_config @@ -277,7 +277,14 @@ function setup_avahi_client { fi } -while [[ $# > 1 ]] +function verify_ssh_server_key { + ssh -o VisualHostKey=yes -o FingerprintHash=sha256 ${PROJECT_NAME}.local -p 2222 & + pid=$! + sleep 15 + kill ${pid} +} + +while [[ $# > 0 ]] do key="$1" @@ -297,6 +304,10 @@ do shift SETUP_CLIENT_APP_NAME=${1} ;; + -v|--verify|--verifykeys) + verify_ssh_server_key + exit 0 + ;; -m|--mesh) shift MESH_CLIENT_INSTALL=${1}