sshconfig-lint / guide
Fix duplicate Host blocks in SSH config
← All SSH config guidesUnderstand 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
- Find both blocks reported as DUP_HOST.
- Move the required directives into one block.
- Remove the duplicate and confirm the result with ssh -G work.
Host work
User deploy
Host work
Port 2222Host work
User deploy
Port 2222