mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-09-25 16:04:52 +08:00
Update ipv4_static_interfaces.cfg
This commit is contained in:
parent
20a279ba3f
commit
fa42adaef8
1 changed files with 16 additions and 1 deletions
|
@ -60,6 +60,13 @@ network:
|
|||
addresses: [ipDNS1, ipDNS2]
|
||||
|
||||
# later commands
|
||||
# Replace ssh port, permit root user login by password, enable sshd service.
|
||||
# Disable kernel need to restart: https://askubuntu.com/questions/1349884/how-to-disable-pending-kernel-upgrade-message
|
||||
# Disable and remove snap permanently: https://sysin.org/blog/ubuntu-remove-snap/
|
||||
# Install some common components.
|
||||
# Rename netplan config file.
|
||||
# Configure fail2ban.
|
||||
# Delete cloud-init config file and disable it permanently after first execution.
|
||||
runcmd:
|
||||
- sed -ri 's/^#?Port.*/Port sshPORT/g' /etc/ssh/sshd_config
|
||||
- sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||
|
@ -68,7 +75,15 @@ runcmd:
|
|||
- /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
|
||||
- apt update
|
||||
- snap remove lxd
|
||||
- snap remove $(snap list | grep "core[0-9]" | head -n 1 | awk '{print $1}')
|
||||
- snap remove snapd
|
||||
- apt autoremove --purge snapd -y
|
||||
- rm -rf /etc/apt/preferences.d/no-snapd.pref
|
||||
- echo 'Package: snapd' > /etc/apt/preferences.d/no-snapd.pref
|
||||
- echo 'Pin: release a=*' >> /etc/apt/preferences.d/no-snapd.pref
|
||||
- echo 'Pin-Priority: -10' >> /etc/apt/preferences.d/no-snapd.pref
|
||||
- apt update -y
|
||||
- apt install dnsutils fail2ban file lrzsz net-tools traceroute unzip vim wget xz-utils -y
|
||||
- sed -ri 's/set compatible/set nocompatible/g' /etc/vim/vimrc.tiny
|
||||
- sed -ri '/set nocompatible/a\set backspace=2' /etc/vim/vimrc.tiny
|
||||
|
|
Loading…
Add table
Reference in a new issue