sshconfig-lint / guide

Put Host * in the correct order

All SSH config guides

Prevent broad SSH defaults from winning before a specific Host block is evaluated.

Why a valid config can still be wrong

For most settings, OpenSSH keeps the first obtained value. Host * near the top can therefore override a specific block below it.

A reliable way to fix it

  1. Move specific Host and Match blocks above the wildcard.
  2. Keep shared defaults in Host * at the end.
  3. Use ssh -G alias to confirm the effective User, HostName, and IdentityFile.
Problem
Host *
  User deploy

Host github.com
  User git
Corrected
Host github.com
  User git

Host *
  User deploy