Why not just use ssh as the knock protocol too? To a bespoke ssh server. Ssh to 7000, type "mellon", and ssh 22 opens up. No other software required, and you clearly already have ssh.
I close SSH port 22 (and what I use instead)
11–20 of 106 posts
Re: I close SSH port 22 (and what I use instead)
#12Is this actually practically reducing the attack surface? We're replacing a battle hardened service with a random one that has the ability to manipulate the firewall rules.
Re: I close SSH port 22 (and what I use instead)
#13> and why it is not enough on its own Nothing is good enough on its own. Geoblocking, fail2ban, port obscurity, SSH keys, limiting logins to specific usernames, not using your public internet nickname, putting things behind CloudFlare tunnels or WireGuard, wildcard DNS obscurity, 2FA... There are many options. Defense in depth is the only way to put services on the internet.
Re: I close SSH port 22 (and what I use instead)
#14Re: I close SSH port 22 (and what I use instead)
#15This is a lot of complexity compared to just not having ssh open to the world (on whatever port you choose to use). Restrict it to the networks where authorized users will be connecting.
Re: I close SSH port 22 (and what I use instead)
#16Re: I close SSH port 22 (and what I use instead)
#17> to be unreachable: no banner, no version string,
> It works, but it has a real weakness:
Re: I close SSH port 22 (and what I use instead)
#18Re: I close SSH port 22 (and what I use instead)
#19Re: I close SSH port 22 (and what I use instead)
#201. Disable all logging about break-in attempts.
2. Do not have any common user names like "root".
Say you want to be able to log in as root from anywhere, just with a password. This is a wise idea; what if you need access, but are in a situation where you are not able to use a certificate?
Make up an alternative name like roto-rooter or whatever pops into your head. Install it into the password file as an alternative name for UID 0. (Make sure it appears later than the "root" entry!). Also edit the shadow file, making sure that the entry is duplicated for the alternative name.
Then in the sshd config file, use AllowUsers to allow only a whitelisted set of users. Here if you say "AllowUsers rotorooter", then the only user id that can authenticate is exactly that one, and it's mapped to UID 0 via passwd/shadow. Add any other accounts you would like to remotely access, giving them similar aliases if they happen to land into a commonly probed space, or are something that a targeted attacker could infer from knowing something about you.
Attackers do not probe the user ID space at all. They concentrate exclusively on probing the password spaces of common user IDs like root, admin, database, www-data, etc. If your system does not support any of those IDs, they are not on a trajectory to crack anything. Your rotorooter password could be "g0d" and they will not get in, if all they ever try is root.