Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A LISP programmer knows the value of everything, but the cost of nothing. -- Alan Perlis


devel / comp.unix.shell / Re: ssh drop connection when running command with output

SubjectAuthor
* ssh drop connection when running command with outputRichard Harnden
`* Re: ssh drop connection when running command with outputLew Pitcher
 +- Re: ssh drop connection when running command with outputRichard Harnden
 `* Re: ssh drop connection when running command with outputChristian Weisgerber
  `- Re: ssh drop connection when running command with outputRichard Harnden

1
ssh drop connection when running command with output

<so885a$6o5$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4650&group=comp.unix.shell#4650

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.shell
Subject: ssh drop connection when running command with output
Date: Wed, 1 Dec 2021 16:33:44 +0000
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <so885a$6o5$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Dec 2021 16:33:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5720de0fa03865836f20ffa0c3bfa297";
logging-data="6917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/r5NJHHwczKDc1sRueju5Euj54KkFpZLs="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Cancel-Lock: sha1:bxfgEQg8k5jE67iq0/eatWZhf0I=
 by: Richard Harnden - Wed, 1 Dec 2021 16:33 UTC

Hi,

I have /etc/ssh/sshd_config containg ...
ClientAliveCountMax 0
ClientAliveInterval 300

If I run a command that takes >300 secs and produces output then it
drops my ssh session:

$ time foo
a b
c d
eConnection to xxx closed by remote host.
Connection to xxx closed.

Now, if I redirect stdout it works fine:

$ time foo >foo.out

real 6m0.68s

It that to be expected?

I would kinda like to see the output as it's generated.

Thanks,
Richard

Re: ssh drop connection when running command with output

<so89r6$718$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4651&group=comp.unix.shell#4651

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: lew.pitc...@digitalfreehold.ca (Lew Pitcher)
Newsgroups: comp.unix.shell
Subject: Re: ssh drop connection when running command with output
Date: Wed, 1 Dec 2021 17:02:30 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <so89r6$718$1@dont-email.me>
References: <so885a$6o5$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 1 Dec 2021 17:02:30 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="ad843b78cc326f4fdbc3d3ed79ed25a4";
logging-data="7208"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/QsrXbGjletdP8aJfdBTe4Uvu6Vu4MRyQ="
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508
git://git.gnome.org/pan2)
Cancel-Lock: sha1:y6D9apx+GLyTyLCk32xd0gmwsG4=
 by: Lew Pitcher - Wed, 1 Dec 2021 17:02 UTC

On Wed, 01 Dec 2021 16:33:44 +0000, Richard Harnden wrote:

> Hi,
>
> I have /etc/ssh/sshd_config containg ...
> ClientAliveCountMax 0
> ClientAliveInterval 300
>
> If I run a command that takes >300 secs and produces output then it
> drops my ssh session:
>
> $ time foo a
> b
> c
> d
> eConnection to xxx closed by remote host.
> Connection to xxx closed.
>
> Now, if I redirect stdout it works fine:
>
> $ time foo >foo.out
>
> real 6m0.68s
>
> It that to be expected?

Given your values for ClientAliveCountMax and ClientAliveInterval,
yes, this behaviour is expected. (see sshd_config(5) for details)

You've set ClientAliveInterval to 300, telling the sshd server
to "send a message through the encrypted channel to request a
response from the client" after 300 seconds of client inactivity.

You've set ClientAliveCountMax to 0, telling the sshd server
that it may send up to zero client alive messages before
terminating the connection.

So, after 300 seconds of client inactivity, the sshd daemon
will terminate it's connection with the client.

> I would kinda like to see the output as it's generated.

So, you have two tuning "knobs" to play with here:
1) ClientAliveInterval, and
2) ClientAliveCountMax

You specifically chose to override the default values for
these two "knobs", presumably to satisfy /some/ requirement.
You can adjust one or both of these values to extend your
inactivity timeout, but we can only /guess/ as to which
value you need to tune to satisfy both your current
requirement ("I would kinda like to see the output as it's
generated" and the original requirement that made you change
the defaults values.

HTH
--
Lew Pitcher
"In Skills, We Trust"

Re: ssh drop connection when running command with output

<so8al5$qhm$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4652&group=comp.unix.shell#4652

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.shell
Subject: Re: ssh drop connection when running command with output
Date: Wed, 1 Dec 2021 17:16:18 +0000
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <so8al5$qhm$1@dont-email.me>
References: <so885a$6o5$1@dont-email.me> <so89r6$718$1@dont-email.me>
Reply-To: nospam.harnden@gmail.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 1 Dec 2021 17:16:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="5720de0fa03865836f20ffa0c3bfa297";
logging-data="27190"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19D5NN1IuXKCqvm5XRkNK8oYz3eeVYWE3M="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Cancel-Lock: sha1:p0oOGv7CaEJ+R4y2zVFepPDBAWU=
In-Reply-To: <so89r6$718$1@dont-email.me>
 by: Richard Harnden - Wed, 1 Dec 2021 17:16 UTC

On 01/12/2021 17:02, Lew Pitcher wrote:
> On Wed, 01 Dec 2021 16:33:44 +0000, Richard Harnden wrote:
>
>> Hi,
>>
>> I have /etc/ssh/sshd_config containg ...
>> ClientAliveCountMax 0
>> ClientAliveInterval 300
>>
>> If I run a command that takes >300 secs and produces output then it
>> drops my ssh session:
>>
>> $ time foo a
>> b
>> c
>> d
>> eConnection to xxx closed by remote host.
>> Connection to xxx closed.
>>
>> Now, if I redirect stdout it works fine:
>>
>> $ time foo >foo.out
>>
>> real 6m0.68s
>>
>> It that to be expected?
>
> Given your values for ClientAliveCountMax and ClientAliveInterval,
> yes, this behaviour is expected. (see sshd_config(5) for details)
>
> You've set ClientAliveInterval to 300, telling the sshd server
> to "send a message through the encrypted channel to request a
> response from the client" after 300 seconds of client inactivity.
>
> You've set ClientAliveCountMax to 0, telling the sshd server
> that it may send up to zero client alive messages before
> terminating the connection.
>
> So, after 300 seconds of client inactivity, the sshd daemon
> will terminate it's connection with the client.

Yes, but why does "tail -f foo.log" count as inactive, but "tail -f
foo.log >/dev/null" will happily run forever.

>
>> I would kinda like to see the output as it's generated.
>
> So, you have two tuning "knobs" to play with here:
> 1) ClientAliveInterval, and
> 2) ClientAliveCountMax
>
> You specifically chose to override the default values for
> these two "knobs", presumably to satisfy /some/ requirement.

The requirement is CIS Red Hat Enterprise Linux 8 Benchmark - 5.2.13
Ensure SSH Idle Timeout Interval is configured.

I'm not sure that I'll be allowed to have any choice.

> You can adjust one or both of these values to extend your
> inactivity timeout, but we can only /guess/ as to which
> value you need to tune to satisfy both your current
> requirement ("I would kinda like to see the output as it's
> generated" and the original requirement that made you change
> the defaults values.

ClientAliveCountMax 1 fixes it.

As does remembering to hit return every 299 seconds.

Re: ssh drop connection when running command with output

<slrnsqfh4o.1iel.naddy@lorvorc.mips.inka.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4653&group=comp.unix.shell#4653

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail
From: nad...@mips.inka.de (Christian Weisgerber)
Newsgroups: comp.unix.shell
Subject: Re: ssh drop connection when running command with output
Date: Wed, 1 Dec 2021 18:53:12 -0000 (UTC)
Message-ID: <slrnsqfh4o.1iel.naddy@lorvorc.mips.inka.de>
References: <so885a$6o5$1@dont-email.me> <so89r6$718$1@dont-email.me>
Injection-Date: Wed, 1 Dec 2021 18:53:12 -0000 (UTC)
Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1";
logging-data="51670"; mail-complaints-to="usenet@mips.inka.de"
User-Agent: slrn/1.0.3 (FreeBSD)
 by: Christian Weisgerber - Wed, 1 Dec 2021 18:53 UTC

On 2021-12-01, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:

>> ClientAliveCountMax 0
>> ClientAliveInterval 300
>
> Given your values for ClientAliveCountMax and ClientAliveInterval,
> yes, this behaviour is expected. (see sshd_config(5) for details)

This has been changed starting from OpenSSH 8.2 (released on 2020-02-14):

Bugfixes
--------
* sshd(8): make ClientAliveCountMax=0 have sensible semantics: it
will now disable connection killing entirely rather than the
current behaviour of instantly killing the connection after the
first liveness test regardless of success. bz2627

The man page now reads
"Setting a zero ClientAliveCountMax disables connection termination."

--
Christian "naddy" Weisgerber naddy@mips.inka.de

Re: ssh drop connection when running command with output

<soab9u$88u$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=4655&group=comp.unix.shell#4655

  copy link   Newsgroups: comp.unix.shell
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: richard....@gmail.com (Richard Harnden)
Newsgroups: comp.unix.shell
Subject: Re: ssh drop connection when running command with output
Date: Thu, 2 Dec 2021 11:39:40 +0000
Organization: A noiseless patient Spider
Lines: 26
Message-ID: <soab9u$88u$1@dont-email.me>
References: <so885a$6o5$1@dont-email.me> <so89r6$718$1@dont-email.me>
<slrnsqfh4o.1iel.naddy@lorvorc.mips.inka.de>
Reply-To: nospam.harnden@gmail.com
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 2 Dec 2021 11:39:42 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e5b6dc31afe39bfeac3c7937543fd829";
logging-data="8478"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18If46F5DkkVxpvyZ1gkHYeuA/AjqXLei0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.3.2
Cancel-Lock: sha1:YxQQepSCaiL4j9sG42advfropjM=
In-Reply-To: <slrnsqfh4o.1iel.naddy@lorvorc.mips.inka.de>
 by: Richard Harnden - Thu, 2 Dec 2021 11:39 UTC

On 01/12/2021 18:53, Christian Weisgerber wrote:
> On 2021-12-01, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>
>>> ClientAliveCountMax 0
>>> ClientAliveInterval 300
>>
>> Given your values for ClientAliveCountMax and ClientAliveInterval,
>> yes, this behaviour is expected. (see sshd_config(5) for details)
>
> This has been changed starting from OpenSSH 8.2 (released on 2020-02-14):
>
> Bugfixes
> --------
> * sshd(8): make ClientAliveCountMax=0 have sensible semantics: it
> will now disable connection killing entirely rather than the
> current behaviour of instantly killing the connection after the
> first liveness test regardless of success. bz2627
>
> The man page now reads
> "Setting a zero ClientAliveCountMax disables connection termination."
>

Thanks.

I also found this: https://bugzilla.redhat.com/show_bug.cgi?id=2008339

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor