Description of problem:
If a client is configured using ipa-client-install then the -4 and -6 flags stop working for ssh.
Version-Release number of selected component (if applicable):
Doesn't matter. Seen on RHEL 6 through 8, and on current Fedora.
Steps to Reproduce:
2. ssh -4 host.example.com
Connected via IPv6
Connected via IPv4
The bug is that sss_ssh_knownhostsproxy is configured on the client and that command doesn't respect the flags given to ssh.
The issue affects all hosts, not just those part of the same FreeIPA domain.
A practical effect of this is that connections get rejected or misbehave because of IP based rules in place for this connection.
I can reproduce it, thank you. However, I'm not sure if proxy commands can even get ssh parameters, Jakub?
The proxy command is was not really designed around the ipa proxy command so there is really no simple way how to make this working out of the box for these ad-hoc commands. When executing proxy commands, the address family is thrown away and there is no address family token that could be passed to the proxy command.
From top of my head one solution could be introduction of address family token that could be passed to IPA proxy command alongside with the hostname and port, but it would require patches for both sss_ssh_knownhostsproxy and ssh. Let me check if OpenSSH upstream would be willing to introduce this new token.
The upstream mailing list thread:
And the bug with patch I filled:
With this, sss_ssh_knownhostsproxy would need to learn -4 and -6 switches and ipa install would need to set-up the %f replacement character for the commandline.
Sounds good to me.
Pavel, one more fast solution that came to my mind would be parsing parent process command-line to get this information from ssh (ssh is always parent process). It would be trivial to catch -4 or -6 options specified on commandline, but more complicated if -oAddressFamily=inet would be user or if AddressFamily would be used from configuration files (unless we would like to parse these too).
Thank you for looking into it. Given this is an SSH limitation I think it is better to wait for official solution instead of implementing some (temporary) workaround.
Is there any openssh ticket that this bug can depend on?
Not yet. Only the upstream links I sent in previous comments. And I am hesitant to create more downstream bugs as we do not have yes/no from upstream.
Hi Jakub, I don't see any progress on the upstream ticket. Should we close this BZ? Or do you have capacity to pursue this further?
Unfortunately, we can't do anything about this without the upstream support.
Sorry, no progress from my side. Upstream was not convinced with the necessity of this and I no longer maintain OpenSSH (added Dima the current maintainer for reference).
But fur the future, I believe sssd should be modified to use KnownHostsCommand instead of ProxyCommand, which will be less fragile for these corner cases. I filled an issue upstream some time ago:
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 32 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Thanks, this seems like a way to go.
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.