I close SSH port 22 (and what I use instead)
michelebologna.net
I close SSH port 22 (and what I use instead)
1–10 of 106 posts
Re: I close SSH port 22 (and what I use instead)
#2 seed=`date +%s%N`; ( echo "secretknock-20260811|$seed"|sha512sum ; echo $seed ) | xargs nc -u 192.168.1.1
It is not secure as hmac and it can be 'trivially' brute forced, but don't require extra tools (probably nc not always readily available).On other hand if threat vector includes network monitor with ability to replay i would use wireguard to wrap ssh traffic.
Re: I close SSH port 22 (and what I use instead)
#3Re: I close SSH port 22 (and what I use instead)
#4Re: I close SSH port 22 (and what I use instead)
#5Nothing 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)
#6Restrict it to the networks where authorized users will be connecting.
Re: I close SSH port 22 (and what I use instead)
#7Is 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.
The goal should be to have your complex layers sitting in front of simpler, easier-to-review lines of defence. Once you get to something like an open connection to ssh, the potential attack surface would be orders of magnitude larger, even though it’s more mature and closely scrutinised.
Re: I close SSH port 22 (and what I use instead)
#8Re: I close SSH port 22 (and what I use instead)
#9> 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.
I use both on one port 22 host. Not much actually touches the server: maybe 5 hosts a day get banned. Meanwhile, China and the Netherlands are forever getting blocked and logged by geoblocking.
I check the 24h log window by country most business days. Some days China leads, other days the Netherlands pulls ahead. Almost never are any other countries close to those two.
Re: I close SSH port 22 (and what I use instead)
#10This was before WireGuard and Tailscale, so the main option for remote access was IPsec or OpenVPN, which are both more complicated than most people want to deal with.