Defaults
Defaults that will be copied into every generated block.
Can be overridden by group or individual host entries.
Supports all options that SSH config supports.
Defaults will be copied into each generated Host block.
---
default:
User: ben
IdentityFile: ~/.ssh/id_rsa
If we combine this with our example in Introduction:
The following yaml:
---
global:
UseRoaming: "no"
default:
IdentityFile: ~/.ssh/id_ed25519
User: ben
local:
Hosts:
nas: 192.168.0.42
pihole:
User: pi
HostName: 192.168.0.2
remote:
Config:
Port: 42022
Hosts:
web1: web.example.org
db: db.example.org
Will produce this config:
# local
Host nas
IdentityFile ~/.ssh/id_ed25519
User ben
HostName 192.168.0.42
Host pihole
IdentityFile ~/.ssh/id_ed25519
User pi
HostName 192.168.0.2
# remote
Host web1
IdentityFile ~/.ssh/id_ed25519
User ben
Port 42022
HostName web.example.org
Host db
IdentityFile ~/.ssh/id_ed25519
User ben
Port 42022
HostName db.example.org
Host *
UseRoaming no