Linux/UNIX: Configure OpenSSH To Listen On an IPv6 Address

To configure OpenSSH to listen on an IPv6 address, you need to modify the sshd_config file. Here’s how to do it:

  1. Open the sshd_config file:
sudo vi /etc/ssh/sshd_config
  1. Find the line that begins with ListenAddress:

If the line exists, you can skip this step. If not, add the following line:

ListenAddress ::

This line tells OpenSSH to listen on all available IPv6 addresses.

  1. Save and close the file:

Press Esc key, then type :wq and press Enter to save and exit.

  1. Restart the sshd service:
sudo service sshd restart

With these steps, you should now have OpenSSH listening on your system’s IPv6 address. You can verify this by running the following command:

sudo netstat -tlnp | grep sshd

You should see a line that shows OpenSSH listening on an IPv6 address. For example:

tcp6 0 0 :::22 :::* LISTEN 11134/sshd

Leave a Comment