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:
- Open the
sshd_configfile:
sudo vi /etc/ssh/sshd_config- Find the line that begins with
ListenAddress:
ListenAddress ::This line tells OpenSSH to listen on all available IPv6 addresses.
- Save and close the file:
Esc key, then type :wq and press Enter to save and exit.- Restart the sshd service:
sudo service sshd restartWith 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 sshdYou should see a line that shows OpenSSH listening on an IPv6 address. For example:
tcp6 0 0 :::22 :::* LISTEN 11134/sshd
