Re: Config to have "ssh too-old-host" error out (with chosen message, and sans actual connection attempt)?

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Mon, 30 Jun 2025 at 21:46, Darren Tucker <dtucker@xxxxxxxxxxx> wrote:

> On Mon, 30 Jun 2025 at 20:47, Jochen Bern <Jochen.Bern@xxxxxxxxx> wrote:
>
>> [...] I'd like to change .ssh/config so that when muscle memory does a
>> "ssh too-old-host" again, I get output to the effect of "use the 'foo
>> bar baz' command instead" (and ideally, OpenSSH itself does not even
>> *attempt* to connect).
>> [...]
>> ProxyCommand seems to be unable, too (because its output apparently gets
>> swallowed *entirely* by ssh).
>>
>
> Its stdout does (since that's its purpose), but its stderr doesn't:
>
> $ cat config
> ProxyCommand sh -c "echo use foo instead >&2"
> $ ssh -F ./config foo bar
> use foo instead
> Connection closed by UNKNOWN port 65535
>

You could also set LogLevel quiet to suppress the "connection closed":

 $ cat config
Host bar
  ProxyCommand sh -c "echo use foo instead >&2"
  LogLevel quiet

$ ssh -F ./config bar
use foo instead

-- 
Darren Tucker (dtucker at dtucker.net)
GPG key 11EAA6FA / A86E 3E07 5B19 5880 E860  37F4 9357 ECEF 11EA A6FA
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux