Vagrant更改默认的SSH端口

vagrant 默认是 22转 2222 端口,可通过下面的方法,转发成 其它端口,如: 2223

1
config.vm.network "forwarded_port", guest: 22, host: 2223, id: "ssh"

参考文章的做法是:

1
2
config.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh", disabled: "true"
config.vm.network "forwarded_port", guest: 22, host: 3333

References

  1. Vagrant更改默认的SSH端口
  2. give a chance to disable default ssh port forwarding