Sfoglia il codice sorgente

Disable temporarily ssh server to avoid warnings

lauhub 8 mesi fa
parent
commit
ceed7f2df8
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  1. 7 0
      scripts/01-renew-ssh-keys

+ 7 - 0
scripts/01-renew-ssh-keys

@@ -15,8 +15,15 @@ renew_ssh_keys(){
   dpkg-reconfigure openssh-server
   status=$?
 }
+# Disables to avoid error messages
+systemctl disable ssh
+systemctl stop ssh
 
 ls /etc/ssh/ssh_host_*key* > /dev/null 2>&1 && renew_ssh_keys || status=1
+
+systemctl enable ssh
+systemctl start ssh
+
 if [ 0 -ne "$status" ]
 then
   # Exit with non zero status