I have a web server running Ubuntu, it has not been broken into in over a decade. Back then, I learned a few tricks.
1. Have an absolute minimum number of user accounts on the machine, like ONE.
(If the user password can be guessed on a non-privileged account, that can be used to try cracking the root password 10,000 times faster than over the net.)
2. Run denyhosts with pretty restrictive settings. Most importantly, do not re-enable attacking IPs in less than 2 weeks.
(I used to have 1000 login attempts/day. 2 weeks after I set up denyhosts, to the exact hour, the attacks dropped to 3/day. Obviously,
the hackers have a net where they compare notes on who has hard security and who is a soft target.)
Once I put in these two protections, I have not been hacked in a decade. The hackers are contantly trying to ssh in, do SQL injection to my web server, etc. but it doesn't work.
Any user computer behind a firewall with NAT, using a little common sense, is fairly safe. I routinely open suspicious emails, and when I click on attachments, I can see "badprogram.exe" as the contents of the archive, and dump it right there. Corrupt archives and documents with macros are flagged by sane software in Linux.
Jon