[Bug 3742] New: ssh_config default values with Host-specific values does not apply

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Fri Oct 11 08:20:04 AEDT 2024


https://bugzilla.mindrot.org/show_bug.cgi?id=3742

            Bug ID: 3742
           Summary: ssh_config default values with Host-specific values
                    does not apply
           Product: Portable OpenSSH
           Version: -current
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: reukiodo at gmail.com

Without any configuration, ssh client uses the username of the logged
in user. If this is not a good default, there is an option to set `User
realusername` in ~/.ssh/config on a per-user basis. However, if there
is a length of hosts, there is no easy way to set a default username
while still allowing a per-Host override.

example 1:
User defaultusername
...
Host a
...
Host b
...
Host z
...
Host A
  User specificusername
...

example 2:
Host *
  User defaultusername
...
Host a
...
Host b
...
Host z
...
Host A
  User specificusername
...

example 3:
Host a
...
Host b
...
Host z
...
Host A
  User specificusername
...
Host *
  User defaultusername
...

In any of these examples, `specificusername` is never used for `Host
A`. The same applies for any setting in `Host *` to set a user default.

Previously there was a https://bugzilla.mindrot.org/show_bug.cgi?id=351
which requested for a ladder-like approach to build complete
configuration in a compact way. While this may be idealistic, at a bare
minimum each user should have the ability to set their own defaults
while still allowing for Host-based configuration overrides.

The steps to build a full config should be something like:
0. (built-in defaults)
1. consult environment (e.g. whoami, ~/.ssh/id_*, etc)
2. system-wide generic configuration (e.g. /etc/ssh/ssh_config:Host *)
3. system-wide specific configuration (e.g. /etc/ssh/ssh_config:Host x)
4. user-specific generic configuration (e.g. ~/.ssh/config:Host *)
5. user-specific specific configuration (e.g. ~/.ssh/config:Host x)
where each step overrides the individual config items from the results
of the previous

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list