sshconfig-lint / guide

Fix duplicate Host blocks in SSH config

All SSH config guides

Understand why repeated Host aliases are confusing and consolidate them without losing settings.

Why a valid config can still be wrong

Repeated Host patterns split one connection across several places. OpenSSH matching rules make it easy to edit a value that never becomes effective.

A reliable way to fix it

  1. Find both blocks reported as DUP_HOST.
  2. Move the required directives into one block.
  3. Remove the duplicate and confirm the result with ssh -G work.
Problem
Host work
  User deploy

Host work
  Port 2222
Corrected
Host work
  User deploy
  Port 2222