From 1b60afdc0fcc83cad1a71f4f2e60ecadd1faaa9d Mon Sep 17 00:00:00 2001 From: Morgan Rhodes Date: Thu, 26 Jan 2017 11:24:18 -0800 Subject: [PATCH] (maint) Add some useful ssh options When sshing to transient VMs it's super useful to ignore host key checking. These options will make sure the host keys for the VMs are not being checked and that they are not getting added to your existing known hosts file. --- lib/vmfloaty/ssh.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vmfloaty/ssh.rb b/lib/vmfloaty/ssh.rb index 4ee4b8c..80ec104 100644 --- a/lib/vmfloaty/ssh.rb +++ b/lib/vmfloaty/ssh.rb @@ -30,7 +30,8 @@ class Ssh end hostname = "#{response[host_os]["hostname"]}.#{response["domain"]}" - cmd = "#{ssh_path} #{user}@#{hostname}" + ssh_options= ["-oStrictHostKeyChecking=no", "-oUserKnownHostsFile=/dev/null"] + cmd = "#{ssh_path} #{ssh_options.join(' ')} #{user}@#{hostname}" # TODO: Should this respect more ssh settings? Can it be configured # by users ssh config and does this respect those settings?