Hi I'm trying to use PuTTY to open a SSH tunnel and connect to a remote MySQL server.
Remote SSH Server IP and port
MySQL Port on the remote server
Tunnel: Local address and port on local machine (I have MySQL Server installed locally, so I'm using 3307 and not 3306 on local machine so there is no conflict with local MySQL Server)
Si I click open, PuTTY asks for an username and password which I provide, if the logon is successful PuTTY immediately closes itself with out any messages or errors
putty.log shows this:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.08.23 07:29:08 =~=~=~=~=~=~=~=~=~=~=~= login as: myUser Using keyboard-interactive authentication. Password for myUser@Server: Could not chdir to home directory /home/myUser: No such file or directory This service allows sftp connections only.
Now, If I try to connect with MySQL Workbench using the option
Standard TCP/IP over SSH, it works...
I've read in forums that the solution is to tweak the options on the SSH server, but I don't have any control over the SSH Server.
Although I can use WorkBench to connect to the database, the goal here, is to have Putty open the SSH tunnel.
How can I open the SSH tunnel with PuTTY? What am I doing wrong? How can I solve this without altering the server?
Using plink: getting the same result
I disabled the Don't start a shell or command at all option as Martin suggested, now I don't receive the SFTP error, but after typing the password nothing happens
The log is just writing what I see in the screen:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2017.08.23 10:07:25 =~=~=~=~=~=~=~=~=~=~=~= login as: user Using keyboard-interactive authentication. Password for user@server:
EDIT 2 - SOLVED
After following Martin Prikryl advice:
I swapped the ports:
L3307 -> 127.0.0.1:3306
Putty event Log now says:
Access granted - Local port 3307 forwarding to 127.0.0.1:3306
Now MySQL WorkBench is able to connect to
In case you need to do this with PLINK, here is how I did it:
plink.exe SSH_SERVER_IP_OR_ADDRESS -P 2204 -ssh -l USER -pw PASSWORD -L 3307:127.0.0.1:3306 -N -v