SSH Tunneling

Hi! I have an instance on EC2 that I'm tunneling into to access a Bitnami install. It works fine as is, however as I check my code I use Chrome accessing http://localhost:8888/ and http://localhost:8888/phpmyadmin.

In order to do so, I have to keep PuTTY open with it's SSH active. This isn't a big hassle, just wondered if I could do the same using PHPStorm. It seems to have every feature known to man. 

I did find a lot of articles talking about making an SSH conn in order to reach a database, however is there the same type of tunneling that PuTTY provides? Would be great to only have to have one tool open.

 

Thanks for any help!

2 comments

Hello,

No, there are no built-in tunneling features like PuTTY.

However you can connect to a database via SSH tunnel in order to work with it directly from PhpStorm: https://www.jetbrains.com/help/phpstorm/connecting-to-a-database.html#connect_via_ssh .

0

Hey Clayton,

 

I came across this while trying to do the same thing. I figured out a way to do it if you have Windows 10. 

The latest version of Windows 10 as a built in SSH client. Here's a video for how to install it if it's not already:  https://www.youtube.com/watch?v=XFINpMs-eWg

Now in PhpStorm just open a new terminal by clicking the "+" next to the current terminal.

I'm going to assume you're connecting with a private key stored in a file. Mine is in my .ssh folder.

now type in the new terminal you opened:

ssh -N -L [local port#]:127.0.0.1:80 -i "path to key file" [remote user name]@[remote ip address]

 

Example for me:

ssh -N -L 8888:127.0.0.1:80 -i "C:\Users\Kevin Campbell\.ssh\mytest.pem" bitnami@54.196.125.137

And now you have an SSH tunnel open and can access the remote site using http://localhost:8888

0

Please sign in to leave a comment.