From 7a2c46da91f9867e3fe1709b2434fe3a0777e693 Mon Sep 17 00:00:00 2001 From: Molly Lau Date: Tue, 14 Nov 2023 02:56:38 +0900 Subject: [PATCH] Update ipv4_static_ipv6_dhcp_interfaces.cfg --- .../Ubuntu/CloudInit/ipv4_static_ipv6_dhcp_interfaces.cfg | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_ipv6_dhcp_interfaces.cfg b/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_ipv6_dhcp_interfaces.cfg index f5b2595..bd2d4b8 100644 --- a/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_ipv6_dhcp_interfaces.cfg +++ b/Linux_reinstall/Ubuntu/CloudInit/ipv4_static_ipv6_dhcp_interfaces.cfg @@ -58,12 +58,13 @@ network: # later commands runcmd: - - systemctl disable ssh.socket - - systemctl enable ssh.service + - systemctl disable --now ssh.socket + - systemctl enable --now 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 + - systemctl restart sshd + - 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