/etc/sshrc executes before a successful ssh login, you can use that to be notified before an attacker has any access to log files
Re:What SSH Hacking Attempts Look Like
by zAy0LfpBZLC8mAC on Sunday May 06, 2018 @07:38AM
(#17006061)
... so? How does that contradict what I wrote?
The SSH daemon logs when it successfully rejects an access. A successfully rejected access is inconsequential to your security. If you are using secure passwords or pubkey authentication, it will never log a successful login by an attacker. What remains then is exploitation of the SSH server ... but the SSH server doesn't have a code path that logs "I have been exploited".