- Change root password
$ passwd
- Create user & their home directory
$ useradd -m <username>
- Set user's password
$ passwd <username>
- Make user a sudoer
$ usermod -aG sudo <username>
- Set user's shell as bash
$ chsh -s /bin/bash <username>
- Disconnect SSH session
- Install essentials
- Update & upgrade
$ sudo apt update && sudo apt upgrade
- Install tools
$ sudo apt install nano curl git htop mlocate dnsutils tmux tree fzf
- Build
locate
's index$ sudo updatedb
- Update & upgrade
- Enable passwordless sudo for user
$ sudo nano /etc/sudoers
- Add:
<username> ALL=(ALL) NOPASSWD: ALL
- Copy SSH public key to remote machine's authorized keys
$ ssh-copy-id -i <public-key-path> <username>@<remote-machine-ip-address>
- Edit SSH daemon configuration
$ sudo nano /etc/ssh/sshd_config
- Disable root access
- Edit:
PermitRootLogin no
- Edit:
- Disable password authentication
- Edit:
PasswordAuthentication no
- Edit:
- Restart ssh service:
$ sudo /etc/init.d/ssh restart
- Set ZSH as default shell
$ sudo apt install zsh
$ sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Configure locale (if not English)
- Install Docker
- Install Docker Compose
- Schedule cleanup of unused Docker images
- Open crontab
$ crontab -e
- Create a new cronjob
- Append:
0 1 * * * sudo docker system prune -af
- Append:
- Open crontab
- Facilitate pushing to ssh git remotes
$ git config receive.denyCurrentBranch updateInstead