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

How do I enable OpenSSH SSH server to listen on an IPv6 address under Linux or UNIX operating systems?

The ListenAddress directive in sshd_config file specifies the local addresses sshd should listen on. The syntax is as follows:

ListenAddress host
ListenAddress IPv4_addr:port
ListenAddress [IPv6_addr]:port

Edit /etc/ssh/sshd_config file, enter:
# vi /etc/ssh/sshd_config
To bind sshd to every IPv4 and IPv6 address on your server, enter:

ListenAddress 0.0.0.0
ListenAddress ::

To bind sshd to every IPv6 2607:f0d0:1002:11::2 address on your server, enter:

ListenAddress [2607:f0d0:1002:11::2]

To bind sshd to every IPv6 2607:f0d0:1002:11::2 address and port 311 on your server, enter:

ListenAddress [2607:f0d0:1002:11::2]:311

From the sshd_man page:

If port is not specified, sshd will listen on the address and all prior Port options specified. The default is to listen on all local addresses. Multiple ListenAddress options are permitted. Additionally, any Port options must precede this option for non port qualified addresses.

Save and close the file. If you changed the port, update your iptables or pf firewall configuration. Finally, reload sshd:
# service sshd reload

Was this answer helpful?

 Print this Article

Also Read

How do I find out System / Server Memory Utilization

free command example Type the free command at shell prompt: $ free $ free -m Output:...

CentOS/RHEL Linux: Remove GDM

How do I uninstall a GUI Gnome login system ( GDM ) from my CentOS Linux v5.5 based server? GDM...

Linux nginx: Chroot (Jail) Setup

You can use traditional chroot kind of setup with nginx. Our sample setup: Jail Directory :...

nginx: Setup SSL Reverse Proxy (Load Balanced SSL Proxy)

everse proxy is a proxy server that is installed in a server network. Typically, reverse proxies...

Change Hostname / Reverse DNS (rDNS) / PTR

To change rDNS/PTR/hostname, please perform these steps: Login to the Clients Area; At the...