From 28e391cb61eb324e39b9613f4965e0385c91627f Mon Sep 17 00:00:00 2001 From: Hendrik Volkmer Date: Sun, 18 Mar 2012 16:32:15 +0100 Subject: [PATCH] Disable IdentitiesOnly for SunSSH SunSSH is default on Solaris/OpenSolaris/Illumos. SunSSH does not support the IdentitiesOnly option. 'vagrant ssh' works when the options is not supplied. --- lib/vagrant/ssh.rb | 7 +++++-- lib/vagrant/util/platform.rb | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index bc2b2013f..5be5494f5 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -76,8 +76,11 @@ module Vagrant # Command line options command_options = ["-p", options[:port].to_s, "-o", "UserKnownHostsFile=/dev/null", - "-o", "StrictHostKeyChecking=no", "-o", "IdentitiesOnly=yes", - "-o", "LogLevel=ERROR"] + "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR"] + + # Solaris/OpenSolaris/Illumos uses SunSSH which doesn't support the IdentitiesOnly option + command_options += ["-o", "IdentitiesOnly=yes"] unless Util::Platform.solaris? + command_options += ["-i", options[:private_key_path]] if !plain_mode command_options += ["-o", "ForwardAgent=yes"] if ssh_info[:forward_agent] diff --git a/lib/vagrant/util/platform.rb b/lib/vagrant/util/platform.rb index 52b39d4bf..a55c4f61c 100644 --- a/lib/vagrant/util/platform.rb +++ b/lib/vagrant/util/platform.rb @@ -14,7 +14,7 @@ module Vagrant platform.include?("darwin9") end - [:darwin, :bsd, :freebsd, :linux].each do |type| + [:darwin, :bsd, :freebsd, :linux, :solaris].each do |type| define_method("#{type}?") do platform.include?(type.to_s) end