diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 7e0e9af37e2..1ba3d0f2144 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -251,7 +251,7 @@ def ready? # Write out the private key in the data dir so that the # machine automatically picks it up. - @machine.data_dir.join("private_key").open("w+") do |f| + @machine.data_dir.join("private_key").open("wb+") do |f| f.write(priv) end