Ssh – Why would I pick IPv4 or IPv6 for SSH access

ipv4ipv6Securityssh

I'm setting up a Linode server and the Getting Started security guide suggests disabling ssh access over either IPv4 or IPv6 so that I only have one of the two enabled.

I understand the general theory of reducing attack surface, but why would I pick one over the other? How do I know which one I need?

Listen on only one internet protocol. The SSH daemon listens for incoming connections over both IPv4 and IPv6 by default. Unless you need to SSH into your Linode using both protocols, disable whichever you do not need. This does not disable the protocol system-wide, it is only for the SSH daemon.

Best Answer

There can be several reasons to disable one or the other. My home and office have stable IPv6 addresses but always changing IPv4 addresses. So firewalling IPv6 is much easier and safer and therefore I close IPv4.

When I need to do maintenance I either ssh from a known network or I open a VPN and get IPv6 addresses that are allowed through the firewall.

It all depends on your environment, but this is what works for me :)