I would like to connect to a Postgres server installed on a remote server using an ssh tunnel. I have Windows so I use cygwin for SSH.
I do the following on cygwin:
# Create the tunnel
ssh -f user@remote_server -p ssh_port -L 5433:127.0.0.1:5432 -N
On pgAdmin, I set the host to localhost and the port to 5433 as well as the username/password/db.
When I try to connect, it is running, and then it displays an error message:
Error connecting to the server: server closed the connection unexpectedly.
On cygwin, I see this message:
Write failed: Broken pipe
The ssh process has actually been killed so I guess it crashed? But why?
How could I get more information to know what the problem is and especially where (pgadmin or ssh tunnel on cygwin...) ?
Thanks
plink
tool supports tunnels, or you can use a saved profile in PuTTY.ssk-keygen -o
(openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man1/ssh-keygen.1) I cannot conver it with puttygen to use it with putty so that is why I wanted to use openssh from within cygwin directly but I do not know whether the issue is on cygwin or pgadmin or even my server..?