From e72753874dd3d5911a7ad729457e48610c425294 Mon Sep 17 00:00:00 2001 From: tH34UT0m4t0R Date: Thu, 12 May 2011 11:23:32 -0700 Subject: [PATCH] add port option to ssh config --- lib/vagrant/config/ssh.rb | 2 ++ lib/vagrant/ssh.rb | 3 +++ 2 files changed, 5 insertions(+) diff --git a/lib/vagrant/config/ssh.rb b/lib/vagrant/config/ssh.rb index 4341bfbea..91de71cd0 100644 --- a/lib/vagrant/config/ssh.rb +++ b/lib/vagrant/config/ssh.rb @@ -12,9 +12,11 @@ module Vagrant attr_accessor :forward_agent attr_accessor :forward_x11 attr_accessor :sudo_shell + attr_accessor :port def initialize @sudo_shell = "bash" + @port = nil end def private_key_path diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index 9066926a3..cc2d42dcf 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -154,6 +154,9 @@ module Vagrant pnum = opts[:port] return pnum if pnum + # Check if a port was specified in the config + return env.config.ssh.port if env.config.ssh.port + # Check if we have an SSH forwarded port pnum = nil env.vm.vm.network_adapters.each do |na|