Skip to content

Disable SSH agent when a tunnel identity file/password is provided (#9814)#10044

Open
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix-9814-ssh-allow-agent
Open

Disable SSH agent when a tunnel identity file/password is provided (#9814)#10044
dpage wants to merge 1 commit into
pgadmin-org:masterfrom
dpage:fix-9814-ssh-allow-agent

Conversation

@dpage

@dpage dpage commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #9814.

When connecting through an SSH tunnel with an explicit identity file or password, pgAdmin still probed the SSH agent, causing repeated authentication attempts/denials (and prompts) from the agent.

Root cause: SSHTunnelForwarder(...) was called without allow_agent, which defaults to True in sshtunnel/paramiko.

Fix: pass allow_agent=False on both tunnel auth paths (identity file and password), since the user has explicitly supplied credentials.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@dpage, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 19 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cd1faf20-7e3f-4a0d-b0d1-f97c744afcc0

📥 Commits

Reviewing files that changed from the base of the PR and between 1a8dcd8 and 4f91c17.

📒 Files selected for processing (2)
  • docs/en_US/release_notes_9_16.rst
  • web/pgadmin/utils/driver/psycopg3/server_manager.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@dpage dpage force-pushed the fix-9814-ssh-allow-agent branch 2 times, most recently from cd68648 to 634f60f Compare June 9, 2026 11:36
…n-org#9814

SSHTunnelForwarder was called without allow_agent, which defaults to True
in sshtunnel/paramiko, so the SSH agent was always probed even when the
user supplied an identity file or password - causing repeated agent
authentication attempts/denials. Pass allow_agent=False on both the
identity-file and password code paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dpage dpage force-pushed the fix-9814-ssh-allow-agent branch from 634f60f to 4f91c17 Compare June 9, 2026 11:37
@asheshv asheshv requested a review from Copilot June 10, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes pgAdmin SSH-tunnel authentication behavior by preventing Paramiko/sshtunnel from probing the user’s SSH agent when explicit tunnel credentials (identity file or password) are intended to be used, avoiding repeated agent authentication prompts/denials (Issue #9814).

Changes:

  • Pass allow_agent=False to SSHTunnelForwarder(...) for both identity-file and password tunnel authentication paths.
  • Add a v9.16 release note entry referencing Issue #9814.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
web/pgadmin/utils/driver/psycopg3/server_manager.py Disables SSH-agent probing for SSH tunnel creation by adding allow_agent to the tunnel forwarder initialization.
docs/en_US/release_notes_9_16.rst Documents the fix in the v9.16 bug fixes section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 603 to 607
(self.tunnel_host, int(self.tunnel_port)),
ssh_username=self.tunnel_username,
ssh_password=tunnel_password,
allow_agent=False,
remote_bind_address=(self.host, self.port),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable SSH agent access if password or identify file is specified for SSH tunnel.

2 participants