How to update vagrant machine's ssh port after "vagrant up"

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to update vagrant machine's ssh port after "vagrant up"

James Smith
Hey guys,

We're using Vagrant to provision machines with chef using both VirtualBox and EC2 providers.

As part of our provisioning process, we change the sshd port on the machine from 22 to 2022, which means the initial "vagrant up" process works fine, but any subsequent "vagrant ssh" or "vagrant provision" calls fail to connect via ssh.

We'd like to configure vagrant so port 22 is only used for ssh for the initial "vagrant up" bootstrapping process, then port 2022 is used for any subsequent vagrant commands. What's the recommended way of making this work for both virtualbox and ec2 providers?

Best
- james

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to update vagrant machine's ssh port after "vagrant up"

Cassiano Leal

According to the documentation, config.ssh.port is your friend: http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html


--
Cassiano Leal
http://cassianoleal.com
http://twitter.com/cassianoleal

On July 22, 2013 at 23:20:14, James Smith ([hidden email]) wrote:

Hey guys,

We're using Vagrant to provision machines with chef using both VirtualBox and EC2 providers.

As part of our provisioning process, we change the sshd port on the machine from 22 to 2022, which means the initial "vagrant up" process works fine, but any subsequent "vagrant ssh" or "vagrant provision" calls fail to connect via ssh.

We'd like to configure vagrant so port 22 is only used for ssh for the initial "vagrant up" bootstrapping process, then port 2022 is used for any subsequent vagrant commands. What's the recommended way of making this work for both virtualbox and ec2 providers?

Best
- james

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: How to update vagrant machine's ssh port after "vagrant up"

James Smith
Thanks Cassiano, I'm aware of the config.ssh.port setting, but I was looking for a way to do this automatically, without having to edit my Vagrantfile after "vagrant up".

On Tuesday, July 23, 2013 5:26:22 AM UTC-7, Cassiano Leal wrote:

According to the documentation, config.ssh.port is your friend: http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html



On July 22, 2013 at 23:20:14, James Smith (<a href="javascript:" target="_blank" gdf-obfuscated-mailto="LJYVc_BsmwMJ">ja...@...) wrote:

Hey guys,

We're using Vagrant to provision machines with chef using both VirtualBox and EC2 providers.

As part of our provisioning process, we change the sshd port on the machine from 22 to 2022, which means the initial "vagrant up" process works fine, but any subsequent "vagrant ssh" or "vagrant provision" calls fail to connect via ssh.

We'd like to configure vagrant so port 22 is only used for ssh for the initial "vagrant up" bootstrapping process, then port 2022 is used for any subsequent vagrant commands. What's the recommended way of making this work for both virtualbox and ec2 providers?

Best
- james

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="LJYVc_BsmwMJ">vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.