What techniques do you use to secure your servers? I've had a lot of good luck with things like SuSE and AppArmor for my servers, but I'm curious if there are other Linux flavors (or other OSs) that have some solid security tools for surviving wild on the internet.
What do you use? What wouldn't you ever use again? Any absolute rules that you force yourself to follow before even bringing your server online?
Thanks!
1. Disable root logins via ssh (as noted above by bbb).
2. Move ssh port from port 22 to something nonstandard. According to my logs, the number of idiots who try brute-force attacks on my machines dropped from 4/day to 0.
3. Put an iptables script into /etc/init.d and make sure it runs on startup at the normal multiuser run levels (on Debian, the command is something like /sbin/update-rc.d, but I don't remember exactly). I looked into more sophisticated firewall packages which generate iptables rules, but found them rather complicated, and probably overkill (YMMV). I essentially blocked all incoming traffic except on the nonstandard ssh port and ports 80 and 443.
Services which use ports other than 80, 443, and ssh should run on a privately routed network, or, at minimum, on a separate network interface with draconian access rules. iptables is pretty easy to use once for this stuff you get the hang of it.