News for hackers. Stuff that matters.
Re:Show HN: Knock-Knock.net – Visualizing the bots knocking ... by bjackman on Monday February 16, 2026 @05:08AM (#47033196)
I wish this would be the default. I expose my homelab port 22 directly to the internet. I'm _pretty_ sure I always always always disable password auth but I do worry about it because most distros have an unsafe default.

(A lot of this risk is mitigated by not having login passwords but I definitely have one node where I have a login password, it's an old laptop so I thought I might want to physically log in for local debugging).

I guess the ideal solution here is to run a prober service that attempts logins and alerts if it gets any responses that smell password auth is possible. But no way I have time to set that up.

Re:Show HN: Knock-Knock.net – Visualizing the bots knocking ... by jbstack on Monday February 16, 2026 @07:33AM (#47034233)
One way to solve this it to use a configuration management tool (Puppet / Chef / Salt / Ansible etc.). Alternatively, run NixOS. You apply the setting once and then it's applied to all your machines from that point onwards.
Re:Show HN: Knock-Knock.net – Visualizing the bots knocking ... by bjackman on Monday February 16, 2026 @11:09AM (#47036766)
I do run NixOS, but it's easy to make mistakes in a complex setup.
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.