Vagrant SSH Tunnelling after using `vagrant ssh`

会有一股神秘感。 提交于 2019-12-05 02:33:52
Ian Ring

I had the same problem, and it turned out to be an old key in my known_hosts file.

So, I did:

$ vi ~/.ssh/known_hosts

went to the line with 127.0.0.1:2200 on it, then did command dd to delete that line.
:x to save, and bam bob's yer uncle. Connection granted, long live Jambi.

I hope that saves someone some grief. Cheers.

I got around this issue by using port forwarding instead of SSH tunnelling. I added the following to Vagrantfile:

config.vm.network :forwarded_port, guest: 3306, host: 8306

Then connected to MySQL via port 8306.

I had the similar issue. I struggled for whole day. I even went through Vagrant and Sequel Pro by Jeffrey Way. Still had a problem. I even changed forwarding port number in Vagrant file and did everything possible. But, the following saved my life.

When I did vagrant reload than I saw

  default: 22 => 2200 (adapter 1)

But, What I was doing was when setting up connection in sequel pro I had written SSH PORT: 2222 I did this based upon the video from the above link. But as soon as I changed to the number I saw with vagrant reload than it asked me for verification. I did select 'YES'. And, it did get connected. Happy ending after a day of struggle. Its for future readers,hopefully someone somewhere won't have to spend a day like me for this reason. ;)

Try to load the another key from folder with vagrant project
E.g. {vagrant_project}/.vagrant/machines/default/virtualbox/private_key

In addition to the above, it could be one of the following problems:

  • The "insecure_private_key" is only used when the box is first brought up. Unless you've disabled the feature (insert_key=false), vagrant will replace that key with a randomly generated one, stored in .vagrant/machines/{machinename}/{providername}/private_key

    You can use that key in your ssh_config

  • Your MySQL settings are doing something different if the connection comes from localhost rather than from the "external" IP address.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!