Skip to content

~/.ssh/config

Config inheritance

First obtained value will be used:

Config:

Host foo
User foot

Host barry
IdentityFile ~/.ssh/another

Host bar*
User bart

Host barman
User barman
HostName barman.example.com

Host foo bar*
HostName example.com

Host foo
IdentityFile ~/.ssh/foo

Host bar*
IdentityFile ~/.ssh/%h

Effect:

runresult
ssh foossh [email protected] -i ~/.ssh/foo
ssh barssh [email protected] -i ~/.ssh/bar
ssh barmanssh [email protected] -i ~/.ssh/barman
ssh barryssh [email protected] -i ~/.ssh/another
ssh barqassh [email protected] -i ~/.ssh/barqa

Source: https://linux.die.net/man/5/ssh_config

Prevent "Too many authentication failures" error

Use:

Host *
IdentitiesOnly=yes

Source: How to Fix "SSH Too Many Authentication Failures" Error