Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "vagrant ssh" work, but PHPStorm 9's "start SSH session" doesn't?

I'm trying to ssh into a Vagrant box inside Mac OSX using PHPStorm 9. It works perfectly from the Terminal or from the command line inside PHPStorm, but PHPStorm's native "Tools -> Start SSH session..." (which should basically do exactly the same: calling "vagrant ssh") does absolutly nothing (no feedback, nothing happens, nothing opens).

Question: Is this a common issue, is something missing, do I have to do some weird configs before ?

like image 702
Sliq Avatar asked May 14 '26 19:05

Sliq


1 Answers

This likely happens because PHP Storm is using your default ssh key where it should use the insecure_private_key key from vagrant:

~/.vagrant.d/insecure_private_key

You can either copy your personal public key to the vagrant box

ssh-copy-id -p 2222 vagrant@localhost

(password: vagrant), or (preferred) configure PHPStorm that it uses the vagrant key, like:

ssh -i ~/.vagrant.d/insecure_private_key localhost -p 2222

Note that I'm using the default forwarded ssh port number 2222, if you are not using this port, pass the port number you are actually using.

like image 50
hek2mgl Avatar answered May 16 '26 09:05

hek2mgl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!