diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f644fec8..9110f1110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ root on the VM. - Gentoo host only networking no longer fails if alrady setup. [GH-286] - Set the host name of your guest OS with `config.vm.host_name` [GH-273] + - `vagrant ssh-config` now outputs the configured `config.ssh.host` ## 0.7.0 (January 19, 2011) diff --git a/lib/vagrant/command/ssh_config.rb b/lib/vagrant/command/ssh_config.rb index a4b1343f0..9a310444e 100644 --- a/lib/vagrant/command/ssh_config.rb +++ b/lib/vagrant/command/ssh_config.rb @@ -11,6 +11,7 @@ module Vagrant $stdout.puts(Util::TemplateRenderer.render("ssh_config", { :host_key => options[:host] || "vagrant", + :ssh_host => vm.env.config.ssh.host, :ssh_user => vm.env.config.ssh.username, :ssh_port => vm.ssh.port, :private_key_path => vm.env.config.ssh.private_key_path diff --git a/templates/ssh_config.erb b/templates/ssh_config.erb index 6c9325ef1..5e319581c 100644 --- a/templates/ssh_config.erb +++ b/templates/ssh_config.erb @@ -1,5 +1,5 @@ Host <%= host_key %> - HostName 127.0.0.1 + HostName <%= ssh_host %> User <%= ssh_user %> Port <%= ssh_port %> UserKnownHostsFile /dev/null