You may specify an alternative known_hosts file in $HOME/.ssh/config
or /etc/ssh/ssh_config
, the parameter UserKnownHostsFile
.
Alternatively, if you prefer to use alternative known_hosts file for a specific SSH invocation, you may use the SSH command option -o UserKnownHostsFile=<alternative known_hosts file>
, e.g. ssh -o UserKnownHostsFile=~/my_temporary_known_host ssh_host
.