@@ -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