+1 for fail2ban and changing default port. Those are a must.
I opened up a SSH server once to the internet telling myself I'll just setup fail2ban later. Within about 5-10 minutes it was compromised. SSH has no anti brute force built in, 10 tries per second, 100 tries per second, 10,000 tries per second, it does not care. Was a worm that basically brute forces into SSH, plants a trojan, then infects other SSH machines from there. My machine had already infected 2 other machines by the time I found it which was almost immediately. I noticed because my internet connection pretty much grinded to a halt. One machine that "I" Infected was a university server, and a government web server or something... I forget. All this within no more then 10 minutes after opening the port. The other mistake I did was using the default port and having an account with username test and password test, which I forgot to delete.
I ended up emailing both parties that got infected just to give them a heads up what happened in case they did not even realize they got hacked. Had I left the building and not notice, it could have been a disaster. All this damage in a matter of minutes. Imagine if it went on for hours.
Thankfully this was a VM that was more or less for testing so it was no big deal to reformat. The biggest danger though is the fact that it was not in a DMZ so I got lucky TBH. Was a fun security experience though.
