Skip to content

Use SSH_ASKPASS_REQUIRE instead of a setting the DISPLAY variable - #305

Merged
ogulcanaydogan merged 1 commit into
jenkinsci:masterfrom
HannesWell:ssh-askpass-require
Aug 19, 2026
Merged

Use SSH_ASKPASS_REQUIRE instead of a setting the DISPLAY variable#305
ogulcanaydogan merged 1 commit into
jenkinsci:masterfrom
HannesWell:ssh-askpass-require

Conversation

@HannesWell

Copy link
Copy Markdown
Contributor

Use environment variable SSH_ASKPASS_REQUIRE=force to enforce the usage of the askpass command:

For me this makes the intend more clear and maybe could prevent any interference with an existing DISPLAY variable (but this is just an assumption and I didn't notice any issues).

Testing done

Only a local execution on Windows.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests that demonstrate the feature works or the issue is fixed

@HannesWell
HannesWell requested a review from a team as a code owner August 16, 2026 15:51
@ogulcanaydogan

Copy link
Copy Markdown
Contributor

Nice, I like this a lot better than the old DISPLAY=bogus hack, it says what it actually means. Checked the man page and SSH_ASKPASS_REQUIRE=force is exactly right, forces askpass regardless of DISPLAY.

One thing worth double-checking before merge: SSH_ASKPASS_REQUIRE is newer than DISPLAY/SSH_ASKPASS, so an older ssh-add that doesn't recognize it would just ignore the var, and now there's no DISPLAY fallback either. Given some of the environments people run this plugin on (older RHEL/Rocky Linux boxes show up a lot in our issue tracker), I'd feel safer keeping both, i.e. leave DISPLAY=bogus in and add SSH_ASKPASS_REQUIRE=force alongside it, rather than replacing one with the other. Costs nothing on modern clients and keeps the old ones working. Happy to be wrong if you've already checked this against an older ssh-add, just wanted to flag it since your own testing note says Windows-only so far.

@HannesWell
HannesWell force-pushed the ssh-askpass-require branch from 44664d4 to 082df47 Compare August 18, 2026 18:45
@HannesWell

Copy link
Copy Markdown
Contributor Author

One thing worth double-checking before merge: SSH_ASKPASS_REQUIRE is newer than DISPLAY/SSH_ASKPASS, so an older ssh-add that doesn't recognize it would just ignore the var, and now there's no DISPLAY fallback either. Given some of the environments people run this plugin on (older RHEL/Rocky Linux boxes show up a lot in our issue tracker), I'd feel safer keeping both,

Makes sense.
From my quick research it seems that SSH_ASKPASS_REQUIRE is only available since about 2020. And while I hope that most people have updated their SSL impl since then, there can indeed be a chance for older systems not supporting that.
Restored the old property as suggested.

@ogulcanaydogan
ogulcanaydogan merged commit 777ca67 into jenkinsci:master Aug 19, 2026
18 checks passed
@HannesWell
HannesWell deleted the ssh-askpass-require branch August 19, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants