Vagrant更改默认的SSH端口

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

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

参考文章的做法是:

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
posted @ 2019-10-22 20:51  五毛钱的饼  阅读(739)  评论(0编辑  收藏  举报