Checklist after New Instance Deployment Aug 13th 2020 Words: 253

System settings

Set timezone

1
# dpkg-reconfigure tzdata

Set time

1
# date --set "25 Sep 2013 15:00:00"

Set hostname

1
2
3
4
# hostname <hostname>

# nano /etc/hosts
# nano /etc/hostname

Use local mirror

1
2
3
4
# nano /etc/apt/source.list

# apt update
# apt upgrade

Create admin

1
2
3
# useradd -m -s `which bash` <user>

# usermod -aG sudo <user>

NOPASSWD:ALL

1
2
3
4
# visudo

// Add at end of the file
<user> ALL=(ALL) NOPASSWD:ALL
1
2
# su alice
$ sudo ls

SSH public key login

1
2
3
4
5
mkdir .ssh

nano .ssh/authorized_keys

chmod 600 .ssh/authorized_keys

SSH port change / disable root login

1
nano /etc/ssh/sshd_config

Create working env

byobu

1
2
3
4
5
6
7
sudo apt install byobu

byobu-enable

nano .byobu/status

nano .byobu/statusrc

zsh & oh-my-zsh

1
2
3
4
5
6
7
8
9
10

sudo apt install zsh

sudo usermod -s `which zsh` <user>

sudo apt install git

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

nano .zshrc

Re-partition

fdisk

1
2
3
4
5
6
sudo fdisk /dev/vda

d d n a w q

sudo resize2fs /dev/vda1

soft swap

1
2
3
4
5
6
7
8
9
10
11
12
13
sudo swapoff -a

sudo fallocate -l 1G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

nano /etc/fstab
# add entry
/swapfile swap swap defaults 0 0

dist upgrade

1
2
3
sudo apt install ubuntu-release-upgrader-core

sudo do-release-upgrade -d

BBR

1
2
3
4
5
6
7
8
9
10
11
12
nano /etc/sysctl.conf
# add the lines
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

sudo sysctl -p

sudo sysctl net.ipv4.tcp_available_congestion_control

sudo sysctl net.ipv4.tcp_congestion_control

lsmod | grep bbr

Unattended upgrade

1
2
3
4
5
6
7
sudo apt install unattended-upgrades

sudo dpkg-reconfigure -plow unattended-upgrades

sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

sudo unattended-upgrades