[Bug 1798049] [NEW] ssh ConnectTimeout is obeyed only on 1st ConnectionAttempt

Vide vide80 at gmail.com
Tue Oct 16 08:57:31 UTC 2018


Public bug reported:

This seems a regression from Ubuntu 17.10 OpenSSH 7.5.

Setting the SSH option ConnectTimeout=N only works on the first
ConnectionAttempts. So, if you set ConnectionAttempts=2 for example, it
will time out after N second on the first attempt and wait the full,
default TCP timeout on the second attempt.

Example of the error:

$ time ssh -vvvv -o ConnectTimeout=2 -o ConnectionAttempts=2  -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null  1.2.3.4
OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /home/vide/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "1.2.3.4" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 1.2.3.4 [1.2.3.4] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 1.2.3.4 port 22: Connection timed out
debug1: Trying again...
debug1: Connecting to 1.2.3.4 [1.2.3.4] port 22.
debug1: connect to address 1.2.3.4 port 22: Connection timed out
ssh: connect to host 1.2.3.4 port 22: Connection timed out

real    2m13,670s
user    0m0,012s
sys     0m0,018s

The first timeout happens after 2 seconds, the second after ~2 minutes

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: openssh-client 1:7.6p1-4
ProcVersionSignature: Ubuntu 4.15.0-34.37-generic 4.15.18
Uname: Linux 4.15.0-34-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 16 10:48:41 2018
InstallationDate: Installed on 2017-11-20 (329 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
RelatedPackageVersions:
 ssh-askpass       N/A
 libpam-ssh        N/A
 keychain          N/A
 ssh-askpass-gnome N/A
SSHClientVersion: OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
SourcePackage: openssh
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: openssh (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug bionic

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/1798049

Title:
  ssh ConnectTimeout is obeyed only on 1st ConnectionAttempt

Status in openssh package in Ubuntu:
  New

Bug description:
  This seems a regression from Ubuntu 17.10 OpenSSH 7.5.

  Setting the SSH option ConnectTimeout=N only works on the first
  ConnectionAttempts. So, if you set ConnectionAttempts=2 for example,
  it will time out after N second on the first attempt and wait the
  full, default TCP timeout on the second attempt.

  Example of the error:

  $ time ssh -vvvv -o ConnectTimeout=2 -o ConnectionAttempts=2  -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null  1.2.3.4
  OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
  debug1: Reading configuration data /home/vide/.ssh/config
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: /etc/ssh/ssh_config line 19: Applying options for *
  debug2: resolving "1.2.3.4" port 22
  debug2: ssh_connect_direct: needpriv 0
  debug1: Connecting to 1.2.3.4 [1.2.3.4] port 22.
  debug2: fd 3 setting O_NONBLOCK
  debug1: connect to address 1.2.3.4 port 22: Connection timed out
  debug1: Trying again...
  debug1: Connecting to 1.2.3.4 [1.2.3.4] port 22.
  debug1: connect to address 1.2.3.4 port 22: Connection timed out
  ssh: connect to host 1.2.3.4 port 22: Connection timed out

  real    2m13,670s
  user    0m0,012s
  sys     0m0,018s

  The first timeout happens after 2 seconds, the second after ~2 minutes

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: openssh-client 1:7.6p1-4
  ProcVersionSignature: Ubuntu 4.15.0-34.37-generic 4.15.18
  Uname: Linux 4.15.0-34-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.4
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Oct 16 10:48:41 2018
  InstallationDate: Installed on 2017-11-20 (329 days ago)
  InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
  RelatedPackageVersions:
   ssh-askpass       N/A
   libpam-ssh        N/A
   keychain          N/A
   ssh-askpass-gnome N/A
  SSHClientVersion: OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n  7 Dec 2017
  SourcePackage: openssh
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1798049/+subscriptions



More information about the foundations-bugs mailing list