IPv4 vs IPv6

The docs about Securing Your Server say:

> 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.

Use the option:

AddressFamily inet to listen only on IPv4.

AddressFamily inet6 to listen only on IPv6.

It makes no mention of how you would choose which one to disable. How do I choose?

5 Replies

I Googled "AddressFamily inet" and the first hit https://ubuntu-tutorials.com/2008/01/12 … s-on-ipv6/">https://ubuntu-tutorials.com/2008/01/12/disabling-ssh-connections-on-ipv6/ says to edit /etc/ssh/sshd_config.

So I'd check the man page or the online documentation for /etc/ssh/sshd_config and you should see details for those options or use the link above.

Oliver, are you asking which one you want to enable or disable? That depends on how you connect to your server. It sounds like you're not familiar with IPv6, so unless you're sure that your ISP uses it (most don't yet), you probably want to enable IPv4 only. If it turns our you're wrong, you can always use lish to regain access.

Hi Alex. Thanks for the reply. That is what I was wondering, yes. This is my first time setting up a server so I am a bit ignorant atm.

By ISP, do you just mean Linode in this case?

The Linode docs say > Linode provides IPv6 support in all of our data centers, and all Linodes are created with one IPv6 address. By default, IPv6 is enabled on all Linodes and the IPv6 address is acquired via Stateless Address Autoconfiguration (SLAAC). -https://www.linode.com/docs/networking/ … networking">https://www.linode.com/docs/networking/native-ipv6-networking

Is there no way of checking before I enable IPv4 only?

ISP is Internet Service Provider, the people you pay for internet in your home / office / whatever. An easy way to check would be to go to https://icanhazip.com/ . If you're on IPv6 you'll get an IP address that looks like 0000:0000::0000:0000:0000:0000. If you're on IPv4 you'll get something like

Thank you :oops: :mrgreen:


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct