Thread: pgAdmin4 ssh tunnel configuration
I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:
parameters and click "Save" I immediately get a dialog box that says:
Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.
I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.
The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
Any suggestions?
Thanks
--
Richard W. Greenwood, PLS
www.greenwoodmap.com
www.greenwoodmap.com
Hi Richard
--

On Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:
I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/
faq/#8
Akshay Joshi
Sr. Software Architect

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
I have same issue now. Here is screenshot:
and log snippet:

pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server
2018-07-02 12:31:29,689: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server
Traceback (most recent call last):
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in create
server_types=ServerType.types()
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect
manager.check_ssh_tunnel_alive()
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive
raise SSHTunnelConnectionLost(self.tunnel_host)
pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server
2018-07-03 12:18:38,773: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server
Traceback (most recent call last):
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in create
server_types=ServerType.types()
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect
manager.check_ssh_tunnel_alive()
File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive
raise SSHTunnelConnectionLost(self.tunnel_host)
pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server
--cnemelka
On Mon, Jul 2, 2018 at 12:44 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi RichardOn Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/faq/#8
--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Hi Cory
Can you please provide the following details:
- Operating system and their version.
- pgAdmin4 version.
- Machine setup and screenshot of the server dialog of the Connection and SSH Tunnel tab if possible.
On Tue, Jul 3, 2018 at 11:49 PM, Cory Nemelka <cnemelka@gmail.com> wrote:
I have same issue now. Here is screenshot:and log snippet:pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server 2018-07-02 12:31:29,689: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__ .py", line 805, in create server_types=ServerType.types() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect manager.check_ssh_tunnel_alive() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive raise SSHTunnelConnectionLost(self.tunnel_host) pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server 2018-07-03 12:18:38,773: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__ .py", line 805, in create server_types=ServerType.types() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect manager.check_ssh_tunnel_alive() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive raise SSHTunnelConnectionLost(self.tunnel_host) pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server --cnemelkaHi RichardOn Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/
faq/#8 --Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Akshay Joshi
Sr. Software Architect

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
answers in-line. It appears that pgAdmin is not even trying to open the tunnel.




--cnemelka
On Tue, Jul 3, 2018 at 10:57 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi CoryCan you please provide the following details:
- Operating system and their version.
windows 10 is where I experience the error. Haven't tried on MAC OS yet
- pgAdmin4 version.

- Machine setup and screenshot of the server dialog of the Connection and SSH Tunnel tab if possible.
Standard windows 10 corporate desktop is the "machine setup". I'm not quite sure what you mean by "machine setup".
Screen shots:



On Tue, Jul 3, 2018 at 11:49 PM, Cory Nemelka <cnemelka@gmail.com> wrote:I have same issue now. Here is screenshot:and log snippet:pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server2018-07-02 12:31:29,689: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in createserver_types=ServerType.types()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connectmanager.check_ssh_tunnel_alive()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_aliveraise SSHTunnelConnectionLost(self.tunnel_host)pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server2018-07-03 12:18:38,773: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in createserver_types=ServerType.types()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connectmanager.check_ssh_tunnel_alive()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_aliveraise SSHTunnelConnectionLost(self.tunnel_host)pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server--cnemelkaOn Mon, Jul 2, 2018 at 12:44 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi RichardOn Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/faq/#8
--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Attachment
Hi Cory
We are not supporting ".ppk" file. We have tested this using "ssh-keygen" where two files private/public key has been created and while creating it we set some password. That password is supplied in the "SSH Tunnel" tab. Public key should be appended to the "authorized_keys" file.
Try the above approach, and if it won't work, please provide the logs. To enable logging, ref: https://www.pgadmin.org/f aq/#8
On Thu, Jul 5, 2018 at 10:32 PM, Cory Nemelka <cnemelka@gmail.com> wrote:
answers in-line. It appears that pgAdmin is not even trying to open the tunnel.--cnemelkaHi CoryCan you please provide the following details:
- Operating system and their version.
windows 10 is where I experience the error. Haven't tried on MAC OS yet
- pgAdmin4 version.
- Machine setup and screenshot of the server dialog of the Connection and SSH Tunnel tab if possible.
Standard windows 10 corporate desktop is the "machine setup". I'm not quite sure what you mean by "machine setup".Screen shots:On Tue, Jul 3, 2018 at 11:49 PM, Cory Nemelka <cnemelka@gmail.com> wrote:I have same issue now. Here is screenshot:and log snippet:pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server 2018-07-02 12:31:29,689: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__ .py", line 805, in create server_types=ServerType.types() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect manager.check_ssh_tunnel_alive() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive raise SSHTunnelConnectionLost(self.tunnel_host) pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server 2018-07-03 12:18:38,773: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__ .py", line 805, in create server_types=ServerType.types() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connect manager.check_ssh_tunnel_alive() File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_alive raise SSHTunnelConnectionLost(self.tunnel_host) pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server --cnemelkaHi RichardOn Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/
faq/#8 --Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246
Akshay Joshi
Sr. Software Architect

Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Mobile: +91 976-788-8246
Attachment
.ppk file is a private key generated by puttygen. It actually works fine. The issue was I was not entering the passphrase for the key ahead of time. I was expecting it to access my ssh-agent (Pageant) or ask me for the passphrase. One I entered the passphrase ahead of time, everything works as expected.
On Thu, Jul 5, 2018, 23:12 Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:
Hi CoryWe are not supporting ".ppk" file. We have tested this using "ssh-keygen" where two files private/public key has been created and while creating it we set some password. That password is supplied in the "SSH Tunnel" tab. Public key should be appended to the "authorized_keys" file.Try the above approach, and if it won't work, please provide the logs. To enable logging, ref: https://www.pgadmin.org/faq/#8On Thu, Jul 5, 2018 at 10:32 PM, Cory Nemelka <cnemelka@gmail.com> wrote:answers in-line. It appears that pgAdmin is not even trying to open the tunnel.--cnemelkaOn Tue, Jul 3, 2018 at 10:57 PM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi CoryCan you please provide the following details:
- Operating system and their version.
windows 10 is where I experience the error. Haven't tried on MAC OS yet
- pgAdmin4 version.
- Machine setup and screenshot of the server dialog of the Connection and SSH Tunnel tab if possible.
Standard windows 10 corporate desktop is the "machine setup". I'm not quite sure what you mean by "machine setup".Screen shots:On Tue, Jul 3, 2018 at 11:49 PM, Cory Nemelka <cnemelka@gmail.com> wrote:I have same issue now. Here is screenshot:and log snippet:pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server2018-07-02 12:31:29,689: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in createserver_types=ServerType.types()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connectmanager.check_ssh_tunnel_alive()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_aliveraise SSHTunnelConnectionLost(self.tunnel_host)pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server2018-07-03 12:18:38,773: ERROR pgadmin: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database serverTraceback (most recent call last):File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\browser\server_groups\servers\__init__.py", line 805, in createserver_types=ServerType.types()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\connection.py", line 237, in connectmanager.check_ssh_tunnel_alive()File "C:\Program Files (x86)\pgAdmin 4\v3\web\pgadmin\utils\driver\psycopg2\server_manager.py", line 430, in check_ssh_tunnel_aliveraise SSHTunnelConnectionLost(self.tunnel_host)pgadmin.utils.exception.SSHTunnelConnectionLost: Connection to the SSH Tunnel for host '10.0.7.172' has been lost. Reconnect to the database server--cnemelkaOn Mon, Jul 2, 2018 at 12:44 AM Akshay Joshi <akshay.joshi@enterprisedb.com> wrote:Hi RichardOn Sun, Jul 1, 2018 at 9:13 PM, Richard Greenwood <richard.greenwood@gmail.com> wrote:I can't get the ssh tunnel configuration that I use with pgAdmin3 to work with 4. After I enter the
parameters and click "Save" I immediately get a dialog box that says:Connection to the SSH Tunnel for host 'my-postgres-server' has been lost. Reconnect to the database server.I'm using identity file authentication. In pgAdmin3 it wants both the private and public key files. In pgAdmin4 only the private file is specified. Otherwise everything is the same.The error is instantaneous and the server is 1000 miles away, so it's not even waiting for a tunnel to get opened or a database connection to be attempted.
- You are creating the ssh tunnel using same machine or there is some another machine in between?
- If it's another machine, have you append the public key to the "authorized_keys" file?
- Can you please provide logs and screenshot of the server dialog with ssh tunnel settings (if possible). To enable logging, ref: https://www.pgadmin.org/faq/#8
--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246--Akshay JoshiSr. Software ArchitectPhone: +91 20-3058-9517
Mobile: +91 976-788-8246