0

I'm having "connection timeout out" problems connecting to a VPS through IPv6. sshd_config is ok, netstat tells me so:

# netstat -natp | grep :22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      29668/sshd      
tcp6       0      0 :::22                   :::*                    LISTEN      29668/sshd      

Do I need additional config?

Additional info:

ssh -vvv6 <FQDN>
OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data ~/.ssh/config
debug1: ~/.ssh/config line 5: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "<FQDN>" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to <FQDN> [*************] port 22.
debug1: connect to address ************* port 22: Connection timed out
ssh: connect to host <FQDN> port 22: Connection timed out
  • What about ping? Do your ISP provide IPv6? – Jakuje May 15 '16 at 17:50
  • ping is ok, AAAA records ok also – Tiago Carrondo May 15 '16 at 17:53
  • What errors you get from "I'm having problems ..."? – Jakuje May 15 '16 at 18:03
  • "ssh: connect to host <FQDN> port 22: Connection timed out" when "ssh -6 <FQDN>" – Tiago Carrondo May 15 '16 at 18:25
  • please, update the question with the important information from the comments and add also output of "ssh -vvv6 <FQDN> – Jakuje May 15 '16 at 18:35
1

I recently ran into this error and determined that by placing an IPv6 address within brackets causes ssh to interpret the IPv6 address as a FQDN and perform a DNS lookup.

The OP may have been using brackets when invoking ssh.

ssh -vvv6 zzz@[3ffc:1900::dead:bea7:dad]
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/zzz/.ssh/config
debug1: /Users/zzz/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "[3ffc:1900::dead:bea7:dad]" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to [3ffc:1900::dead:bea7:dad] [xxxx:xxxx:xxxx::1] port 22.
debug1: connect to address xxxx:xxxx:xxxx::1 port 22: Operation timed out

The intended [IPv6] resolves to the wrong IP address. Instead, remove the brackets surrounding the IPv6 address:

ssh -vvv6 zzz@3ffc:1900::dead:bea7:dad
OpenSSH_7.4p1, LibreSSL 2.5.0
debug1: Reading configuration data /Users/zzz/.ssh/config
debug1: /Users/zzz/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: resolving "3ffc:1900::dead:bea7:dad" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 3ffc:1900::dead:bea7:dad [3ffc:1900::dead:bea7:dad] port 22.

The latter example would work if it were a legitimate address.

Solution: Remove the brackets when connecting to an IPv6 address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.