|
|
|
Ask HN: My Linux server was hacked
|
|
5 points
by yuashizuki
4073 days ago
|
|
I dont understand how my linux server got hacked? the ssh key was also compromised. I have switched the server off and plan to reinstall a new linux distribution. I also changed my profile password of linode. Do I need to do anything else to protect my self again? Thanks for reading. |
|
I can remember many many moons ago I got hacked too so I know the feeling. If you don't have mission critical stuff, this can be a good thing though, makes you learn how to lock down your servers.
Besides locking down your SSH config, Fail2Ban is nice, and be sure to set your iptables so your only accepting packets you want. Also here's a list of other things I usually do:
1. Depending on your distro there's usually a way to install automatic security updates, in debian its called unattended upgrades (https://wiki.debian.org/UnattendedUpgrades)
2. Install logwatch to keep yourself periodically updated with whats going on.
3. Control your packages. If you don't need services make sure your box is clean of them. Basically, for every service you have on the machine thats one more possible attack point, so just use the ones you know you need.
4. In your firewall ignore icmp_echo and icmp_echo_ignore_broadcasts if you can. There's also other stuff you can do in sysctl and with SELinux but I've never really had the need.