From 4e108bccaee302028c84a69d5f76c63497ae476a Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Tue, 14 Nov 2023 01:56:27 +0900 Subject: [PATCH] Update ipv4_static_interfaces.cfg --- Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg b/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg index 30ddd70..ccfe0a7 100644 --- a/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg +++ b/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_interfaces.cfg @@ -74,12 +74,11 @@ network: # Update grub. # Delete cloud-init config file itself and disable it permanently after first execution. runcmd: - - systemctl disable ssh.socket - - systemctl enable ssh.service - systemctl daemon-reload - update-rc.d ssh enable - kill -9 $(ps -ef | grep '/usr/sbin/sshd' | gawk '$0 !~/grep/ {print $2}' | tr -s '\n' ' ') - /etc/init.d/ssh restart + - ufw allow sshPORT - sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf - sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf - apt update