Port Sentry is your friend
A. The Sentry tools provide host-level security services for the UNIX platform. PortSentry, Logcheck/LogSentry, and HostSentry protect against portscans, automate log file auditing, and detect suspicious login activity on a continuous basis.
It can also automatically respond to scans by blocking the originating hosts.
I have been using it continuously since the 1990's