Skip to content

Instantly share code, notes, and snippets.

@potix2
Created September 9, 2012 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save potix2/3686783 to your computer and use it in GitHub Desktop.
Save potix2/3686783 to your computer and use it in GitHub Desktop.
Add ssh verbose mode for Vagrant
diff --git a/config/default.rb b/config/default.rb
index 8a50b7e..2dfb27a 100644
--- a/config/default.rb
+++ b/config/default.rb
@@ -11,6 +11,7 @@ Vagrant.configure("1") do |config|
config.ssh.forward_agent = false
config.ssh.forward_x11 = false
config.ssh.shell = "bash -l"
+ config.ssh.verbose = false
config.vm.auto_port_range = (2200..2250)
config.vm.box_url = nil
diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb
index 5551375..62a18c6 100644
--- a/plugins/communicators/ssh/communicator.rb
+++ b/plugins/communicators/ssh/communicator.rb
@@ -144,6 +144,9 @@ module VagrantPlugins
:config => false,
:forward_agent => ssh_info[:forward_agent]
}
+ if @machine.config.ssh.verbose
+ opts[:verbose] = 0
+ end
# Check that the private key permissions are valid
Vagrant::Util::SSH.check_key_permissions(ssh_info[:private_key_path])
diff --git a/plugins/kernel_v1/config/ssh.rb b/plugins/kernel_v1/config/ssh.rb
index d6719a1..b5d0eca 100644
--- a/plugins/kernel_v1/config/ssh.rb
+++ b/plugins/kernel_v1/config/ssh.rb
@@ -14,6 +14,7 @@ module VagrantPlugins
attr_accessor :forward_agent
attr_accessor :forward_x11
attr_accessor :shell
+ attr_accessor :verbose
def validate(env, errors)
[:username, :host, :max_tries, :timeout].each do |field|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment