I'm not the best person at this, but I do the following on any machine I deal with which does not sit behind a firewall: 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…
4. Disable password authentication for SSH and use a public/private key. Of course, use a good password on the private key.
5. (bonus) keep the installed software to the bare minimum. Less software, less bugs.
6. (extra bonus) look apache's mod_security, it's an application level firewall (filters requests to the application, so, for example, you can filter SQL injections or invalid characters before they reach your app).