this post was submitted on 22 Nov 2023
3 points (100.0% liked)

Homelab

22 readers
1 users here now

Rules

founded 1 year ago
MODERATORS
 

Started off by

  1. Enabling unattended updates
  2. Enable only ssh login with key
  3. Create user with sudo privileges
  4. Disable root login
  5. Enable ufw with necessary ports
  6. Disable ping
  7. Change ssh default port 21 to something else.

Got the ideas from networkchuck

Did this on the proxmox host as well as all VMs.

Any suggestions?

you are viewing a single comment's thread
view the rest of the comments
[–] theniwo@alien.top 1 points 1 year ago (1 children)

Enabling unattended updates -> Hell no. Regular Patchdays
Enable only ssh login with key -> yes
Create user with sudo privileges -> yes
Disable root login -> no
Enable ufw with necessary ports -> Basic iptables, but not on all hosts. But fail2ban
Disable ping -> nope
Change ssh default port 21 to something else. -> nope

[–] lack_of_reserves@alien.top 1 points 1 year ago (1 children)

Remember to configure fail2ban, the defaults are silly.

Also, these days I prefer crowdsec to fail2ban.

[–] theniwo@alien.top 1 points 1 year ago (1 children)

Can you give me ressources on how to configure f2b?

I usually leave the defaults, or maybe tweak the times a bit.

One could only enter my network thru vpn or nginx on 443 anyway, so I am not that worried

[–] lack_of_reserves@alien.top 1 points 1 year ago (1 children)

The majority of the default fail2ban installations only bans an IP for 10 minutes and uses a 10 minute findtime, e.g. slow brute forcing is not at all banned.

Before I switched to crowdsec (which I really recommend you do, its quite easy) I changed my bantime and findtime in /etc/fail2ban/jail.conf (I think I made a local file... read the file it should say) to something like 8 hours (e.g. change 10m to 640m for both those variables).

[–] theniwo@alien.top 1 points 1 year ago (1 children)

Well if you are using strong passwords or no passwords from outside at all, but key auth only, i think you are pretty in the safe side. As i said, i have no ssh port open to the internet. Raising the ban time could only lead to banning myself. 😀

But for ports open to the outside, yes. I ppbly would do that too. Plus hardening the ssh config a bit

[–] lack_of_reserves@alien.top 1 points 1 year ago

I have an open ssh port and I use key auth with password as well as crowdsec. Even if people get my ssh key they would still need to know the password.