Store host keys in a dedicated file.
Section: Authentication
Use a custom known_hosts file
bash
bash
ssh -o UserKnownHostsFile=~/.ssh/known_hosts.work user@example.comExplanation
Store host keys in a dedicated file.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Authentication
Accept new host keys automatically
Accept first-seen host keys but still protect against changed keys.
Override host key algorithms
Specify accepted host key algorithms explicitly.
Restrict preferred auth methods
Control which auth methods the client attempts first.