Обсуждение: pgAdmin 4 SSH tunnel appears to be ignoring port setting
I am running a database in a virtual machine. I can successfully SSH into the virtual machine using this command: ssh vagrant@localhost -p 2222 -i /Users/michael/Code/gvip/puphpet/files/dot/ssh/id_rsa …and then I can connect to the database by running: psql dbname username However, I am not having any luck getting pgAdmin 4 to connect via SSH tunnel. Here is what I have entered on the settings screen: <http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png> And here is what I see when I then try to connect: <http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png> I then click OK (without entering anything) and see this error message("Failed to create the SSH tunnel. Error: Could not establish session to SSH gateway"): <http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png> Here is what I see in the logs: 2018-08-02 12:01:21,033| ERROR | Could not connect to gateway localhost:22 : 61 2018-08-02 12:01:21,050: ERROR pgadmin: Could not establish session to SSH gateway Traceback (most recent call last): File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/utils/driver/psycopg2/server_manager.py", line 415, in create_ssh_tunnel self.tunnel_object.start() File "/Applications/pgAdmin 4.app/Contents/Resources/venv/lib/python3.6/site-packages/sshtunnel.py", line 1295, in start reason='Could not establish session to SSH gateway') File "/Applications/pgAdmin 4.app/Contents/Resources/venv/lib/python3.6/site-packages/sshtunnel.py", line 1101, in _raise raise exception(reason) sshtunnel.BaseSSHTunnelForwarderError: Could not establish session to SSH gateway 2018-08-02 12:01:21,068: ERROR pgadmin: Could not connected to server(#2) - 'GViP on Vagrant (localhost)'. Error: Failed to create the SSH tunnel. Error: Could not establish session to SSH gateway It looks from this log like pgAdmin is trying to connect on port 22, ignoring my setting of port 2222. Is this possible? -- Sent from: http://www.postgresql-archive.org/PostgreSQL-pgadmin-support-f2191615.html
Hi Michael
Issue has been fixed and will be available in the next release.
On Thu, 2 Aug 2018, 23:57 michael_cgla, <michael@cg-la.com> wrote:
I am running a database in a virtual machine. I can successfully SSH into the
virtual machine using this command:
ssh vagrant@localhost -p 2222 -i
/Users/michael/Code/gvip/puphpet/files/dot/ssh/id_rsa
…and then I can connect to the database by running:
psql dbname username
However, I am not having any luck getting pgAdmin 4 to connect via SSH
tunnel. Here is what I have entered on the settings screen:
<http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png>
And here is what I see when I then try to connect:
<http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png>
I then click OK (without entering anything) and see this error
message("Failed to create the SSH tunnel. Error: Could not establish session
to SSH gateway"):
<http://www.postgresql-archive.org/file/t352060/Screen_Shot_2018-08-02_at_11.png>
Here is what I see in the logs:
2018-08-02 12:01:21,033| ERROR | Could not connect to gateway localhost:22
: 61
2018-08-02 12:01:21,050: ERROR pgadmin: Could not establish session to SSH
gateway
Traceback (most recent call last):
File "/Applications/pgAdmin
4.app/Contents/Resources/web/pgadmin/utils/driver/psycopg2/server_manager.py",
line 415, in create_ssh_tunnel
self.tunnel_object.start()
File "/Applications/pgAdmin
4.app/Contents/Resources/venv/lib/python3.6/site-packages/sshtunnel.py",
line 1295, in start
reason='Could not establish session to SSH gateway')
File "/Applications/pgAdmin
4.app/Contents/Resources/venv/lib/python3.6/site-packages/sshtunnel.py",
line 1101, in _raise
raise exception(reason)
sshtunnel.BaseSSHTunnelForwarderError: Could not establish session to SSH
gateway
2018-08-02 12:01:21,068: ERROR pgadmin: Could not connected to server(#2) -
'GViP on Vagrant (localhost)'.
Error: Failed to create the SSH tunnel.
Error: Could not establish session to SSH gateway
It looks from this log like pgAdmin is trying to connect on port 22,
ignoring my setting of port 2222. Is this possible?
--
Sent from: http://www.postgresql-archive.org/PostgreSQL-pgadmin-support-f2191615.html
Great! Thanks Akshay. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-pgadmin-support-f2191615.html