I often do a lot of work with temporary Vagrant, Docker, VMs, and I don’t really want those host keys clogging up my ~/.ssh/known_hosts file. So I just add the following alias to my shell “rc” file. In my case, I use zsh so it’s ~/.zshrc :

alias ssh-nocheck="ssh -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null'"

Viola!  Now all I need to is to use something akin to:

ssh-nocheck -p 2222 root@192.168.2.138

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s