pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Error while connection via ssh tunnel and ssh key authentication

Open chaosben opened this issue 1 year ago • 42 comments

While connection to a server using ssh tunnel and key authentication for the tunnel, the error "module 'paramiko' has no attribute 'DSSKey'" occurs.

To Reproduce

Steps to reproduce the behavior:

  1. Connect to a server via ssh and use an key agent
  2. See the error

Expected behavior

The error should not occur.

Error message

module 'paramiko' has no attribute 'DSSKey'

Screenshots

Image

Desktop (please complete the following information):

  • Version: 9.7
  • Application Mode: Desktop
  • Commit: cad6025ce9900dbe29c36e62d7bfb721a9820955 2025-08-20
  • Python Version: 3.13.7
  • Current User: [email protected]
  • Electron Version: 35.4.0
  • Browser: Chrome 134.0.6998.205
  • Operating System: Windows-11-10.0.26100-SP0

chaosben avatar Aug 21 '25 10:08 chaosben

Same here on Mac OS 15.6 Desktop app. PgAdmin version 9.7

javinto avatar Aug 21 '25 11:08 javinto

Hi All,

Sure, we will verify it. Just for your information, we haven’t made any changes to the SSHTunnel logic. It looks like the Paramiko package released a new version (4.0.0) on August 4, 2025.

akshay-joshi avatar Aug 21 '25 11:08 akshay-joshi

Same here. Can we downgrade pgAdmin as a temp fix?

WayneHiller avatar Aug 21 '25 20:08 WayneHiller

I have the same issue, similar setup. Was fixed by downgrading back to 9.6

Orrison avatar Aug 21 '25 21:08 Orrison

@Orrison I am having the issue in version 9.6. Hmmm, can I even downgrade pgAdmin since I installed it with PG 17.6? For now I have been just doing ssh port forwarding in Powershell.

WayneHiller avatar Aug 21 '25 22:08 WayneHiller

Oh sorry, I mis-read this all. I am on Mac OS. Not sure if that makes a difference

Orrison avatar Aug 21 '25 22:08 Orrison

Same here. Version 9.7

ms2907 avatar Aug 23 '25 14:08 ms2907

This is an issue with sshtunnel as its dependency paramiko==4.0.0 has dropped DSSKey (DSAKey) support. See: https://github.com/pahaz/sshtunnel/pull/301

To fix this, you can manually install paramiko==3.5.1 in your pgAdmin 4's Python environment. python3 -m pip install paramiko==3.5.1 Then relaunch pgAdmin4 to take effect.

You may need to replace python3 depending on your installation. With a package installation on Windows 11, it's on 'C:\Users\%USERNAME%\AppData\Local\Programs\pgAdmin 4\python\python.exe'.

naoki-h-dtsi avatar Aug 25 '25 01:08 naoki-h-dtsi

on apple silicon with pgadmin4 installed via brew the command is /Applications/pgAdmin\ 4.app/Contents/Frameworks/Python.framework/Versions/3.13/bin/pip3 install paramiko==3.5.1

saveli avatar Aug 25 '25 10:08 saveli

For anyone experiencing this in Ubuntu 24.04

Close pgadmin, then remove paramiko and install 3.5.1 as prompt by @naoki-h-dtsi source /usr/pgadmin4/venv/bin/activate sudo /usr/pgadmin4/venv/bin/pip uninstall paramiko sudo /usr/pgadmin4/venv/bin/pip install paramiko==3.5.1

Relaunch pgadmin, should work

dimzog avatar Aug 25 '25 12:08 dimzog

All,

I have pinned the Paramiko version to 3.5.1. Please test the fix on tomorrow's snapshot build 26-08.

Ensure the folder is dated 26th Aug or later.

akshay-joshi avatar Aug 25 '25 12:08 akshay-joshi

For anyone who have pgAdmin4 installed via Flatpak, here's how I temporarily fixed it:

  1. Close pgAdmin4 if it's currently running
  2. Create a virtual environment with the correct paramiko version:
mkdir -p ~/.local/share/pgadmin-fix
cd ~/.local/share/pgadmin-fix
python3 -m venv venv
source venv/bin/activate
pip install paramiko==3.5.1
  1. Configure the Flatpak to use the fixed paramiko version:
flatpak override --user --env=PYTHONPATH="/home/$USER/.local/share/pgadmin-fix/venv/lib/python3.12/site-packages" org.pgadmin.pgadmin4
  1. Verify the fix:
flatpak run --command=python3 org.pgadmin.pgadmin4 -c "import paramiko; print('Paramiko version:', paramiko.__version__)"

Should output: Paramiko version: 3.5.1

To undo the fix (if needed):

flatpak override --user --reset org.pgadmin.pgadmin4
rm -rf ~/.local/share/pgadmin-fix

This creates avirtual environment with the compatible paramiko version and configuring the Flatpak application to prioritize it in the Python path, without affecting the system-wide Python installation.

Tested on: KDE Neon with pgAdmin4 Flatpak version 9.7

TimKraemer avatar Aug 25 '25 15:08 TimKraemer

Same here, not able to connect to any SSL Tunnel.

EddySoeparmin235 avatar Aug 25 '25 16:08 EddySoeparmin235

Temporal solution for mac silicons

$ cd /Applications/pgAdmin 4.app/Contents/Frameworks/Python.framework/Versions/3.13/bin
$ sudo ./pip3 uninstall paramiko  
$ sudo ./pip3 install paramiko==2.11.0

And restart pgadmin

yasmin-11 avatar Aug 25 '25 16:08 yasmin-11

It did not work using the steps you provided @yasmin-11. Here's the error message:

connection failed: connection to server at "", port 55568 failed: FATAL: password authentication failed for user "" connection to server at "", port 55568 failed: FATAL: no pg_hba.conf entry for host "", user """, database "", no encryption

EddySoeparmin235 avatar Aug 25 '25 16:08 EddySoeparmin235

@EddySoeparmin235 Your error usually means one of these things:

  • In pgAdmin, you might be mixing up your SSH and Postgres credentials. Remember: SSH username/password (or key) go in the SSH Tunnel tab, and Postgres username/password go in the Connection tab.
  • On your server, pg_hba.conf may not allow connections from localhost.

My fix is for DSSKey because newer versions of Paramiko removed support for old DSA keys.

yasmin-11 avatar Aug 25 '25 17:08 yasmin-11

Same here on Ubuntu 22.04.05 LTS

shitwolfymakes avatar Aug 25 '25 17:08 shitwolfymakes

@yasmin-11 Not sure what or how I entered the remote password incorrectly earlier, but now it's working. Thanks a lot.

I do hope that pgAdmin team fixes the Paramiko issue soon for other people because this is a show stopper. If I didn't come to this forum, I'll be SOL.

EddySoeparmin235 avatar Aug 25 '25 19:08 EddySoeparmin235

Same here on Ubuntu 24.04 (actually Linux Mint). To revert to pgadmin4 version 9.6: sudo apt install pgadmin4=9.6 pgadmin4-server=9.6 pgadmin4-desktop=9.6 pgadmin4-web=9.6

rgreenwood avatar Aug 25 '25 22:08 rgreenwood

All,

As mentioned in the ticket, we’ve pinned Paramiko to version 3.5.1. Could someone please test the nightly build and let us know if the issue is resolved? Nightly Build

akshay-joshi avatar Aug 26 '25 06:08 akshay-joshi