diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 0e951e4e7..c2077235f 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -281,6 +281,9 @@ module Vagrant info[:forward_agent] = @config.ssh.forward_agent info[:forward_x11] = @config.ssh.forward_x11 + # add in provided proxy command config + info[:proxy_command] = @config.ssh.proxy_command if @config.ssh.proxy_command + # Set the private key path. If a specific private key is given in # the Vagrantfile we set that. Otherwise, we use the default (insecure) # private key, but only if the provider didn't give us one. diff --git a/plugins/communicators/ssh/communicator.rb b/plugins/communicators/ssh/communicator.rb index 1abd22c7e..1c96481ca 100644 --- a/plugins/communicators/ssh/communicator.rb +++ b/plugins/communicators/ssh/communicator.rb @@ -5,6 +5,7 @@ require 'timeout' require 'log4r' require 'net/ssh' +require 'net/ssh/proxy/command' require 'net/scp' require 'vagrant/util/ansi_escape_code_remover' @@ -208,6 +209,7 @@ module VagrantPlugins :logger => ssh_logger, :verbose => :debug }) + connect_opts[:proxy] = Net::SSH::Proxy::Command.new(ssh_info[:proxy_command]) if ssh_info[:proxy_command] @logger.info("Attempting to connect to SSH...") @logger.info(" - Host: #{ssh_info[:host]}") diff --git a/plugins/kernel_v2/config/ssh.rb b/plugins/kernel_v2/config/ssh.rb index 6775cd4a3..12aa576a6 100644 --- a/plugins/kernel_v2/config/ssh.rb +++ b/plugins/kernel_v2/config/ssh.rb @@ -10,6 +10,7 @@ module VagrantPlugins attr_accessor :guest_port attr_accessor :keep_alive attr_accessor :shell + attr_accessor :proxy_command attr_reader :default