Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #244964

Re: OpenSSH: cause of random kex_exchange_identification errors?

From Bijan Soleymani <bijan@psq.com>
Newsgroups linux.debian.user
Subject Re: OpenSSH: cause of random kex_exchange_identification errors?
Date 2022-02-02 17:50 +0100
Message-ID <DMqZr-8o5-1@gated-at.bofh.it> (permalink)
References <DMp7j-7gJ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2022-02-02 09:44, Vincent Lefevre wrote:
> In the source, this corresponds to function kex_exchange_identification
> in kex.c:
> 
>      len = atomicio(read, ssh_packet_get_connection_in(ssh),
>          &c, 1);
>      if (len != 1 && errno == EPIPE) {
>              error_f("Connection closed by remote host");
>              r = SSH_ERR_CONN_CLOSED;
>              goto out;
>      } else if (len != 1) {
>              oerrno = errno;
>              error_f("read: %.100s", strerror(errno));
>              r = SSH_ERR_SYSTEM_ERROR;
>              goto out;
>      }
> 
> so either with EPIPE or with ECONNRESET, and this apparently occurs
> before the exchange of banners.

If you look at the source of atomicio you will see that in this case it 
will do a read() of 1 byte on the file descriptor used for communicating 
with the other side.

atomicio will set errno to EPIPE if 0 bytes are returned on any of the 
reads it does

and it returns the number of bytes read, which will be 0 or 1 in this case.

So the failure modes are 0 bytes read and read didn't return an error 
(EPIPE), or 0 bytes read and read did return an error (read returns -1 
and sets errno to something other than EPIPE).

But I think basically this means that read on the socket fails, or 
basically can't read from the network.

Bijan

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-02-02 15:50 +0100
  Re: OpenSSH: cause of random kex_exchange_identification errors? Hans <hans.ullrich@loop.de> - 2022-02-02 16:20 +0100
    Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-02-02 16:30 +0100
  Re: OpenSSH: cause of random kex_exchange_identification errors? Bijan Soleymani <bijan@psq.com> - 2022-02-02 17:50 +0100
  Re: OpenSSH: cause of random kex_exchange_identification errors? David Wright <deblis@lionunicorn.co.uk> - 2022-02-02 18:00 +0100
  Re: OpenSSH: cause of random kex_exchange_identification errors? gene heskett <gheskett@shentel.net> - 2022-02-02 20:30 +0100
    Re: OpenSSH: cause of random kex_exchange_identification errors? Greg Wooledge <greg@wooledge.org> - 2022-02-02 20:30 +0100
      Reusing ssh keys on a new installation, was Re: OpenSSH: cause of  random kex_exchange_identification errors? David Wright <deblis@lionunicorn.co.uk> - 2022-02-02 22:00 +0100
    Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-02-03 04:20 +0100
  Re: OpenSSH: cause of random kex_exchange_identification errors? Henrique de Moraes Holschuh <hmh@debian.org> - 2022-02-05 22:40 +0100
    Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-02-08 11:20 +0100
    Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-06-07 18:00 +0200
      Re: OpenSSH: cause of random kex_exchange_identification errors? Tim Woodall <debianuser@woodall.me.uk> - 2022-06-07 18:20 +0200
        Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-06-14 13:00 +0200
          Re: OpenSSH: cause of random kex_exchange_identification errors? Tim Woodall <debianuser@woodall.me.uk> - 2022-06-14 20:20 +0200
            Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-06-15 03:50 +0200
              Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-06-15 15:20 +0200
                Re: OpenSSH: cause of random kex_exchange_identification errors? Vincent Lefevre <vincent@vinc17.net> - 2022-06-15 16:00 +0200

csiph-web