Ver código fonte

Additional security guidance

Bob Mottram 8 anos atrás
pai
commit
93383ded9d
1 arquivos alterados com 16 adições e 1 exclusões
  1. 16
    1
      src/freedombone-sec

+ 16
- 1
src/freedombone-sec Ver arquivo

@@ -692,7 +692,22 @@ function store_passwords {
692 692
     sel=$?
693 693
     case $sel in
694 694
         0)
695
-            ${PROJECT_NAME}-pass --enable yes
695
+            if [ -f /root/.nostore ]; then
696
+                read_config_param "MY_USERNAME"
697
+                if [ ! -f /home/$MY_USERNAME/.ssh/authorized_keys ]; then
698
+                    dialog --title $"Store Passwords" \
699
+                           --msgbox $"\nYou should first enable key based ssh login to improve security" 8 60
700
+                    return
701
+                fi
702
+                if [[ $SSH_PASSWORDS == 'yes' ]]; then
703
+                    dialog --title $"Store Passwords" \
704
+                           --msgbox $"\nYou should disable ssh passwords to improve security" 8 60
705
+                    return
706
+                fi
707
+                ${PROJECT_NAME}-pass --enable yes
708
+                dialog --title $"Store Passwords" \
709
+                       --msgbox $"\nUser passwords will now be stored on the system" 8 60
710
+            fi
696 711
             return
697 712
             ;;
698 713
         1)