Update ipv4_static_ipv6_static_interfaces.cfg

This commit is contained in:
Molly Lau 2023-11-14 02:56:52 +09:00 committed by GitHub
parent 7a2c46da91
commit c8a1c70eab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,12 +60,13 @@ network:
# later commands # later commands
runcmd: runcmd:
- systemctl disable ssh.socket - systemctl disable --now ssh.socket
- systemctl enable ssh.service - systemctl enable --now ssh.service
- systemctl daemon-reload - systemctl daemon-reload
- update-rc.d ssh enable - update-rc.d ssh enable
- kill -9 $(ps -ef | grep '/usr/sbin/sshd' | gawk '$0 !~/grep/ {print $2}' | tr -s '\n' ' ') - 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{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf
- sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf - sed -i "s/#\$nrconf{kernelhints} = -1;/\$nrconf{kernelhints} = -1;/g" /etc/needrestart/needrestart.conf
- apt update - apt update