sshvagrantvagrant-windows

Vagrant ssh connect to host 127.0.0.1:2222 port 22: Bad file number


Whenever I try to connect to my local Vagrant, I get this error when I run ssh vagrant@127.0.0.1:2222 from the Windows git bash:

ssh: connect to host 127.0.0.1:2222 port 22: Bad file number

It was working previously, so I'm not sure what could have caused this. When I try to do an SFTP connection in PHPStorm 8, I get this error:

Connection to '127.0.0.1' failed.
SSH_MSG_DISCONNECT: 2 Too many authentication failures for vagrant 

I've tried vagrant destroy with vagrant box remove laravel/homestead and then recreating the box from a backup I had that previously worked using vagrant box add laravel/homestead homestead.box but I still get the same errors.

I'm on Windows 7.

What can I do to get access to my vagrant box commandline again?


Solution

  • Make sure your vagrant is up and running by command : vagrant up

    and then do vagrant ssh. It will connect to vagrant localhost