News for hackers. Stuff that matters.
Re:Show HN: Knock-Knock.net – Visualizing the bots knocking ... by jamiemallers on Monday February 16, 2026 @10:02AM (#47035873)
You can do this in about 5 lines of bash with a cron job. Something like:

  ssh -o PreferredAuthentications=password -o PubkeyAuthentication=no -o BatchMode=yes user@host 2>&1 | grep -q "Permission denied" && echo "password auth enabled on host" | mail -s "SSH audit alert" [email protected]
If you get "Permission denied (password)" back, the server is accepting password auth attempts. If it immediately drops you with "Permission denied (publickey)", you're good.

The tricky part is that sshd_config can be overridden per-user with Match blocks, so ideally you'd probe with a few different usernames. But even a basic probe catches the 90% case of someone forgetting PasswordAuthentication no.

For the laptop with a real login password: you could set PasswordAuthentication no in sshd_config but keep the login password for local console access. Those are independent settings - sshd_config only affects remote SSH, not local login.

Re:Show HN: Knock-Knock.net – Visualizing the bots knocking ... by jcynix on Monday February 16, 2026 @01:41PM (#47038541)
When you get a "Permission denied (publickey)." if you try to connect to a server which requires a public key for authentication, it causes your 5 lines to wrongly raise an alarm ... you need to adapt your grep.