Преглед на файлове

Allow verification of the ssh host key

Bob Mottram преди 8 години
родител
ревизия
9c2c644310
променени са 2 файла, в които са добавени 28 реда и са изтрити 18 реда
  1. 24
    18
      src/freedombone-sec
  2. 4
    0
      src/freedombone-utils-ssh

+ 24
- 18
src/freedombone-sec Целия файл

@@ -690,16 +690,17 @@ function menu_security_settings {
690 690
     trap "rm -f $data" 0 1 2 5 15
691 691
     dialog --backtitle $"Freedombone Control Panel" \
692 692
            --title $"Security Settings" \
693
-           --radiolist $"Choose an operation:" 16 76 16 \
694
-           1 $"Regenerate ssh host keys" off \
695
-           2 $"Regenerate Diffie-Hellman keys" off \
696
-           3 $"Update cipersuite" off \
697
-           4 $"Create a new Let's Encrypt certificate" off \
698
-           5 $"Renew Let's Encrypt certificate" off \
699
-           6 $"Enable GPG based authentication (monkeysphere)" off \
700
-           7 $"Register a website with monkeysphere" off \
701
-           8 $"Allow ssh login with passwords" off \
702
-           9 $"Go Back/Exit" on 2> $data
693
+           --radiolist $"Choose an operation:" 17 76 17 \
694
+           1 $"Show ssh host public key" off \
695
+           2 $"Regenerate ssh host keys" off \
696
+           3 $"Regenerate Diffie-Hellman keys" off \
697
+           4 $"Update cipersuite" off \
698
+           5 $"Create a new Let's Encrypt certificate" off \
699
+           6 $"Renew Let's Encrypt certificate" off \
700
+           7 $"Enable GPG based authentication (monkeysphere)" off \
701
+           8 $"Register a website with monkeysphere" off \
702
+           9 $"Allow ssh login with passwords" off \
703
+           10 $"Go Back/Exit" on 2> $data
703 704
     sel=$?
704 705
     case $sel in
705 706
         1) exit 1;;
@@ -722,33 +723,38 @@ function menu_security_settings {
722 723
 
723 724
     case $(cat $data) in
724 725
         1)
725
-            regenerate_ssh_host_keys
726
+            dialog --title $"SSH host public key" \
727
+                   --msgbox "$(get_ssh_server_key)" 6 70
728
+            exit 0
726 729
             ;;
727 730
         2)
728
-            regenerate_dh_keys
731
+            regenerate_ssh_host_keys
729 732
             ;;
730 733
         3)
734
+            regenerate_dh_keys
735
+            ;;
736
+        4)
731 737
             interactive_setup
732 738
             update_ciphersuite
733 739
             ;;
734
-        4)
740
+        5)
735 741
             create_letsencrypt
736 742
             ;;
737
-        5)
743
+        6)
738 744
             renew_letsencrypt
739 745
             ;;
740
-        6)
746
+        7)
741 747
             enable_monkeysphere
742 748
             ;;
743
-        7)
749
+        8)
744 750
             register_website
745 751
             ;;
746
-        8)
752
+        9)
747 753
             allow_ssh_passwords
748 754
             change_ssh_settings
749 755
             exit 0
750 756
             ;;
751
-        9)
757
+        10)
752 758
             exit 0
753 759
             ;;
754 760
     esac

+ 4
- 0
src/freedombone-utils-ssh Целия файл

@@ -152,4 +152,8 @@ function configure_firewall_for_ssh {
152 152
     mark_completed $FUNCNAME
153 153
 }
154 154
 
155
+function get_ssh_server_key {
156
+    echo $(ssh-keygen -lf /etc/ssh/ssh_host_rsa_key.pub | awk -F ' ' '{print $2}')
157
+}
158
+
155 159
 # NOTE: deliberately no exit 0