Bug 3066

Summary: ConnectTimeout ignored for second IP address for host?
Product: Portable OpenSSH Reporter: Jonathan Kamens <jik>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED DUPLICATE    
Severity: enhancement CC: djm
Priority: P5    
Version: 7.9p1   
Hardware: Other   
OS: Linux   

Description Jonathan Kamens 2019-09-06 00:02:52 AEST
If I do `ssh -v -o ConnectTimeout=1 -o StrictHostKeyChecking=no` to a host which has two addresses, one IPv4 and one IPv6, then it appears that the `ConnectTimout=1` setting is only obeyed for the first connection attempt:

```
$ ssh -v -o ConnectTimeout=1 -o StrictHostKeyChecking=no elided.host.name true 2>&1 | while read line; do echo "$(date) $line"; done
Thu 05 Sep 2019 09:57:52 AM EDT OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b  26 Feb 2019
Thu 05 Sep 2019 09:57:52 AM EDT debug1: Reading configuration data home/elided-username/.ssh/config
Thu 05 Sep 2019 09:57:52 AM EDT debug1: home/elided-username/.ssh/config line 13: Applying options for *
Thu 05 Sep 2019 09:57:52 AM EDT debug1: Reading configuration data /etc/ssh/ssh_config
Thu 05 Sep 2019 09:57:52 AM EDT debug1: /etc/ssh/ssh_config line 19: Applying options for *
Thu 05 Sep 2019 09:57:52 AM EDT debug1: Connecting to elided.host.name [elided:ipv6:address] port 22.
Thu 05 Sep 2019 09:57:53 AM EDT debug1: connect to address elided:ipv6:address port 22: Connection timed out
Thu 05 Sep 2019 09:57:53 AM EDT debug1: Connecting to elided.host.name [elided.ipv4.address] port 22.
Thu 05 Sep 2019 10:00:04 AM EDT debug1: connect to address elided.ipv4.address port 22: Connection timed out
Thu 05 Sep 2019 10:00:04 AM EDT ssh: connect to host elided.host.name port 22: Connection timed out
```
Comment 1 Damien Miller 2019-09-06 12:51:00 AEST

*** This bug has been marked as a duplicate of bug 2918 ***
Comment 2 Damien Miller 2021-04-23 15:08:45 AEST
closing resolved bugs as of 8.6p1 release