[Command] Windows WSL2 SSH Tunnel Authentication failed PHPStorm and DBeaver #692
Replies: 1 comment
-
Hi All, |
Beta Was this translation helpful? Give feedback.
-
Hi All, |
Beta Was this translation helpful? Give feedback.
-
Version of Warden
0.14.0
Operating System and Installation Method
Windows 11 via WSL 2 via Homebrew
Describe the Bug
I'm getting an error: Cannot connect to remote host: host not found from using windows using WSL2 with warden for magento 2.4.6 when trying to connect to the database with DBeaver.
The error I'm getting is in PHPStorm when I'm setting up the SSH configuration to connect to the database from warden. I'm getting a Connection to [email protected]:2222 Cannot connect to remote host: host not found . Even when I press the test connection button in SSH configuration window for PHPStorm I'm getting this host not found error.
I think the error is probably because I'm using windows with WSL2 using the ubuntu VM and the extra step is causing the ssh connection to fail.
I've tried using these configuration settings to access my Database from Phpstorm and DBeaver: https://docs.warden.dev/configuration/database.html#phpstorm. My settings in PHPStorm for the SSH Configuration is Host: tunnel.warden.test , Port: 2222, Username: user, Private key file: \wsl$\Ubuntu\home<myusername>.warden\tunnel\ssh_key and Parse config file ~/.ssh/config is turned on.
For the settings on the General PHPStorm page I'm using Host: youtube-demo-db-1 (this is the name of my container from warden env ps), Port: 3306, User: magento, Password: magento: Database: magento
However, when I try the command within my ubuntu WSL2 command line:
I've also checked in my /etc/ssh/ssh_config and see this entry which I see was mentioned above:
I looked at the solution here: #27 (comment) by @erikhansen but I don't see this file ~/.ssh/config in my Ubuntu WSL 2 machine.
I'm seeing this:
So I don't have anything to delete I'm just very confused because ssh works fine but the ssh configuration to my WSL 2 ubuntu vm running mysql does not work.
I've also tried using:
warden svc up --force-recreate tunnel
But it doesn't work, the host not found error still happens.
As mentioned in this issue here: #260 (comment)
And I've also tried warden env down and warden env up to recreate all the containers 3 times and the error still happens.
but it doesn't make a difference the host is unknown in php storm for the ssh connection and it refuses to connect.
Temporary workaround:
using warden db connect to run sql commands from the commandline instead which works.
To Reproduce
Expected Behavior
When configuring SSH Connection in PHPStorm, press the Test Connection button using these settings: https://docs.warden.dev/configuration/database.html#phpstorm
And pressing Test Connection the SSH connection to Warden running on WSL2 should have connection successful. And PHPStorm should be able to connect to the magento database running through WSL2 on warden.
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions