[Bug 3742] ssh_config default values with Host-specific values does not apply
bugzilla-daemon at mindrot.org
bugzilla-daemon at mindrot.org
Fri Oct 11 09:27:47 AEDT 2024
https://bugzilla.mindrot.org/show_bug.cgi?id=3742
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |WORKSFORME
CC| |djm at mindrot.org
--- Comment #1 from Damien Miller <djm at mindrot.org> ---
The approach in example 3 works fine:
> [djm at desktop ~]$ cat > /tmp/cfg
> Host a
> User user_a
> Host b
> User user_b
> Host A
> User specificusername
> Host *
> User defaultusername
> [djm at desktop ~]$ ssh -F /tmp/cfg -G A | grep '^user '
> user specificusername
> [djm at desktop ~]$ ssh -F /tmp/cfg -G a | grep '^user '
> user user_a
> [djm at desktop ~]$ ssh -F /tmp/cfg -G xxx | grep '^user '
> user defaultusername
You can also use Match final if you prefer the list the defaults first,
though this will cause the config to be evaluated twice.
> [djm at desktop ~]$ cat > /tmp/cfg
> Match final
> User defaultusername
> Host a
> User user_a
> Host b
> User user_b
> Host A
> User specificusername
> [djm at desktop ~]$ ssh -F /tmp/cfg -G A | grep '^user '
> user specificusername
> [djm at desktop ~]$ ssh -F /tmp/cfg -G a | grep '^user '
> user user_a
> [djm at desktop ~]$ ssh -F /tmp/cfg -G xxx | grep '^user '
> user defaultusername
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
More information about the openssh-bugs
mailing list