瀏覽代碼

Disable temporarily ssh server to avoid warnings

lauhub 8 月之前
父節點
當前提交
ceed7f2df8
共有 1 個文件被更改,包括 7 次插入0 次删除
  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