mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-10-01 10:54:46 +08:00
Update ipv4_static_interfaces.cfg
This commit is contained in:
parent
4aeab996be
commit
dd570c0f21
1 changed files with 6 additions and 4 deletions
|
@ -64,19 +64,21 @@ network:
|
|||
# Enable sshd service.
|
||||
# Reload systemd.
|
||||
# Make sshd service loading automatically at the next reboot.
|
||||
# Restart the sshd service.
|
||||
# Kill the original sshd service so that to liberate the occupation of "0.0.0.0:22" and "[::]:22" to avoid "error: Bind to port sth on sth failed: Address already in use." causes restarting and applying new configs failure of the sshd service.
|
||||
# Restart sshd service.
|
||||
# Disable kernel need to restart: https://askubuntu.com/questions/1349884/how-to-disable-pending-kernel-upgrade-message
|
||||
# Install some common components.
|
||||
# Configure vim for more convenient to use.
|
||||
# Rename netplan config file.
|
||||
# Configure fail2ban.
|
||||
# Configure and restart fail2ban.
|
||||
# Update grub.
|
||||
# Delete cloud-init config file itself and disable it permanently after first execution.
|
||||
runcmd:
|
||||
- systemctl disable --now ssh.socket
|
||||
- systemctl enable --now ssh.service
|
||||
- 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
|
||||
- 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
|
||||
|
|
Loading…
Add table
Reference in a new issue