Subject: ssh tunneling

From: Juan Ignacio Fernigrini <[email-masked]>
Date: Mon, 22 Jan 2024 21:11:49 -0300

Good morning team,

I hope this message finds you well.

I am tasked with establishing a connection to my database using ODBC with
SSH tunneling. Unfortunately, the current ODBC solution is not compatible.
I have explored alternatives such as Devart, but it comes at a cost of
$250. I am considering whether it would be more beneficial to invest this
amount in developing the required feature within the existing open-source
ODBC solution.

Best regards,
Juan Ignacio Fernigrini

---

From: Dave Cramer <[email-masked]>
Date: Tue, 23 Jan 2024 16:06:38 -0500

> amount in developing the required feature within the existing open-source

I'm not sure why psql odbc would not be able to use ssh tunneling. Can you
expand upon that ?
Dave Cramer
www.postgres.rocks

---

From: Dave Cramer <[email-masked]>
Date: Tue, 23 Jan 2024 16:25:45 -0500

> I'm not sure why psql odbc would not be able to use ssh tunneling. Can you

see What is an SSH Tunnel & SSH Tunneling?
<https://www.ssh.com/academy/ssh/tunneling#:~:text=SSH%20tunneling%20is%20a%20method%20of%20transporting%20arbitrary,Private%20Networks%29%20and%20access%20intranet%20services%20across%20firewalls.>

For details it is not part of the driver.

Dave

---

From: Jon Raiford <[email-masked]>
Date: Tue, 23 Jan 2024 21:49:23 +0000

As Dave mentions, SSH tunneling should work ok. You need to make sure you set up the tunnel correctly. I would suggest testing this using something like netcat to make sure the tunnel is working. If you can connect to netcat with telnet and PostgreSQL is still not connecting then you may want to have a look at your pg_hba.conf configuration to make sure it is set up to accept connections from your SSH server.

Jon

From: Dave Cramer <[email-masked]>
Date: Tuesday, January 23, 2024 at 4:35 PM
To: Juan Ignacio Fernigrini <[email-masked]>
Cc: [email-masked] <[email-masked]>
Subject: Re: ssh tunneling

On Tue, 23 Jan 2024 at 15:28, Juan Ignacio Fernigrini <[email-masked]<mailto:[email-masked]>> wrote:
Good morning team,

I am tasked with establishing a connection to my database using ODBC with SSH tunneling. Unfortunately, the current ODBC solution is not compatible. I have explored alternatives such as Devart, but it comes at a cost of $250. I am considering whether it would be more beneficial to invest this amount in developing the required feature within the existing open-source ODBC solution.

Best regards,
Juan Ignacio Fernigrini

I'm not sure why psql odbc would not be able to use ssh tunneling. Can you expand upon that ?
Dave Cramer
www.postgres.rocks<http://www.postgres.rocks>

see What is an SSH Tunnel & SSH Tunneling?<https://www.ssh.com/academy/ssh/tunneling#:~:text=SSH%20tunneling%20is%20a%20method%20of%20transporting%20arbitrary,Private%20Networks%29%20and%20access%20intranet%20services%20across%20firewalls.>

Dave

---

From: Jacobo Sánchez López <[email-masked]>
Date: Wed, 24 Jan 2024 09:39:37 +0100

Maybe the original message is about SSH proxy instead of tunneling?

The PostgreSQL protocol makes a SSH upgrade instead of starting the 
communication with SSH handshake and that is a problem when using some 
SSH proxies/load balancers which are nowadays common in cloud 
environments. I also wish there was a way to connect directly to a SSH 
socket but that is not about the driver but how PostgreSQL communication 
protocol I guess.

Regards

Jacobo

On 1/23/2024 10:49 PM, Jon Raiford wrote:
>
> As Dave mentions, SSH tunneling should work ok. You need to make sure 
> you set up the tunnel correctly. I would suggest testing this using 
> something like netcat to make sure the tunnel is working. If you can 
> connect to netcat with telnet and PostgreSQL is still not connecting 
> then you may want to have a look at your pg_hba.conf configuration to 
> make sure it is set up to accept connections from your SSH server.
>
> Jon
>
> *From: *Dave Cramer <[email-masked]>
> *Date: *Tuesday, January 23, 2024 at 4:35 PM
> *To: *Juan Ignacio Fernigrini <[email-masked]>
> *Cc: [email-masked] <[email-masked]>
> *Subject: *Re: ssh tunneling
>
>     On Tue, 23 Jan 2024 at 15:28, Juan Ignacio Fernigrini
>     <[email-masked]> wrote:
>
>         Good morning team,
>
>         I am tasked with establishing a connection to my database
>         using ODBC with SSH tunneling. Unfortunately, the current ODBC
>         solution is not compatible. I have explored alternatives such
>         as Devart, but it comes at a cost of $250. I am considering
>         whether it would be more beneficial to invest this amount in
>         developing the required feature within the existing
>         open-source ODBC solution.
>
>         Best regards,
>         Juan Ignacio Fernigrini
>
>     www.postgres.rocks <http://www.postgres.rocks>
>

---

From: Tom Lane <[email-masked]>
Date: Wed, 24 Jan 2024 11:39:45 -0500

> socket but that is not about the driver but how PostgreSQL communication 

FYI, there's some work going on to make it possible to begin the
connection with an SSL handshake:

https://www.postgresql.org/message-id/flat/CAM-w4HOEAzxyY01ZKOj-iq=M4-VDk=[email-masked]

If you'd like to see that move along, review and especially
testing of the proposed patch would help make it happen.

			regards, tom lane

---

From: Jacobo Sánchez López <[email-masked]>
Date: Wed, 24 Jan 2024 17:55:08 +0100

Oh, thanks for letting me know.

     That sounds great, will take a look at it.

Regards

---

From: Juan Ignacio Fernigrini <[email-masked]>
Date: Fri, 26 Jan 2024 15:19:50 -0300

Thanks, I'll look into it.

El mar, 23 ene 2024 a la(s) 6:49 p.m., Jon Raiford ([email-masked])
escribió:

> As Dave mentions, SSH tunneling should work ok. You need to make sure you
> set up the tunnel correctly. I would suggest testing this using something
> like netcat to make sure the tunnel is working. If you can connect to
> netcat with telnet and PostgreSQL is still not connecting then you may want
> to have a look at your pg_hba.conf configuration to make sure it is set up
> to accept connections from your SSH server.
>
>
>
> Jon
>
>
>

-- 
Atte Juan I Fernigrini