September
2nd,
2022
- Add non-root user.
I.# useradd -m USERNAME
II.# passwd USERNAME
III. Add your user to thewheel
orsudo
group:- DEB based distros:
# usermod -aG sudo USERNAME
- RPM based distros:
# usermod -aG wheel USERNAME
- DEB based distros:
-
Disable root logins.
I.# vim /etc/ssh/sshd_config
II. SetPermitRootLogin=no
-
Change SSH port
-
Use non-root user
-
(Just my preference) Install
zsh
&oh-my-zsh
- Set up SSH keys
- If no exsisting key, generate one first
- On local machine:
$ ssh-copy-id USERNAME@IP_ADDRESS
(If SSH port changed:$ ssh-copy-id -p PORT USERNAME@IP_ADDRESS
)
-
Configure
ufw
firewall -
Install
Fail2Ban
-
(If possible) Use Docker rootless
- (From: https://docs.docker.com/engine/install/linux-postinstall/) If using regular Docker, don’t forget:
$ sudo groupadd docker
$ sudo usermod -aG docker $USER
- Reboot
- (Optional) Disable SMTP port