マリウス . A GTK4 ssh-askpass in Zig
Every ssh-askpass in the Gentoo tree pulls in X11 or a full KDE stack,<br>so I wrote my own with Zig 0.16 and GTK4, with hand-written bindings that<br>keep X out of the build.
I run hardened Gentoo on my laptop, and most of the time I<br>never touch ssh-askpass because I’m using -sk keys for most of the systems.<br>There is one class of situation where I do need it, though, which is when a<br>program wants an SSH key passphrase for a regular ED25519 key, but has no<br>terminal to read it from. The usual case is go get, or the go toolchain in<br>general, fetching a private module over SSH during a build that runs without a<br>TTY. OpenSSH can’t prompt on a pipe, so it runs whatever SSH_ASKPASS points<br>at and puts the passphrase prompt in a window instead. For years I had nothing<br>installed for that and had to work around these scenarios. The main reason for<br>that is what Gentoo’s Portage offers:<br> ~ emerge -s ssh-askpass
[ Results for search key : ssh-askpass ]<br>Searching...
* kde-plasma/ksshaskpass<br>Latest version available: 6.6.6<br>Latest version installed: [ Not Installed ]<br>Size of files: 32 KiB<br>Homepage: https://kde.org/plasma-desktop https://invent.kde.org/plasma/ksshaskpass<br>Description: Implementation of ssh-askpass with KDE Wallet integration<br>License: GPL-2
* lxqt-base/lxqt-openssh-askpass<br>Latest version available: 2.4.0<br>Latest version installed: [ Not Installed ]<br>Size of files: 19 KiB<br>Homepage: https://lxqt-project.org/ https://github.com/lxqt/lxqt-openssh-askpass/<br>Description: LXQt OpenSSH user password prompt tool<br>License: LGPL-2.1 LGPL-2.1+
* net-misc/gnome-ssh-askpass<br>Latest version available: 10.0_p1<br>Latest version installed: [ Not Installed ]<br>Size of files: 1,927 KiB<br>Homepage: https://www.openssh.com/<br>Description: GTK-based passphrase dialog for use with OpenSSH<br>License: BSD GPL-2
* net-misc/ssh-askpass-fullscreen<br>Latest version available: 1.2<br>Latest version installed: [ Not Installed ]<br>Size of files: 81 KiB<br>Homepage: https://github.com/atj/ssh-askpass-fullscreen<br>Description: A small SSH Askpass replacement written with GTK2<br>License: GPL-2+
* net-misc/x11-ssh-askpass<br>Latest version available: 1.2.4.1-r2<br>Latest version installed: [ Not Installed ]<br>Size of files: 30 KiB<br>Homepage: https://github.com/sigmavirus24/x11-ssh-askpass<br>Description: X11-based passphrase dialog for use with OpenSSH<br>License: HPND
[ Applications found : 5 ]
Each of these has at least one inconvenience I didn’t feel like putting up with.<br>My system runs with the global -X USE flag, so anything that needs X11 is<br>out before I look any further. Of the five, kde-plasma/ksshaskpass is the only<br>one with no X11 dependency whatsoever, which should have made it the<br>obvious pick, but the trouble is everything else that comes with it. As a<br>Sway user, I did not want a full KDE stack on the machine just to<br>type the occasional passphrase, and that is what a ksshaskpass install pulls<br>in:<br>~ # emerge -a kde-plasma/ksshaskpass
These are the packages that would be merged, in order:
Calculating dependencies... done!<br>Dependency resolution took 1.18 s (backtrack: 0/20).
[ebuild N ] kde-frameworks/kf-env-6<br>[ebuild N ] dev-libs/plasma-wayland-protocols-1.21.0 USE="-test"<br>[ebuild N ] dev-libs/qtkeychain-0.16.0 USE="-keyring -test"<br>[ebuild N ] kde-frameworks/ksecretd-services-6.27.0 USE="(-systemd)"<br>[ebuild N ] kde-frameworks/breeze-icons-6.27.0 USE="-test"<br>[ebuild N ] kde-frameworks/ki18n-6.27.0 USE="-debug -test" PYTHON_SINGLE_TARGET="python3_14 -python3_12 -python3_13"<br>[ebuild N ] kde-frameworks/kconfig-6.27.0 USE="dbus -debug -qml -test"<br>[ebuild N ] kde-frameworks/kcoreaddons-6.27.0 USE="dbus -debug -test"<br>[ebuild N ] kde-frameworks/kwidgetsaddons-6.27.0 USE="-debug -designer -test"<br>[ebuild N ] kde-frameworks/kdbusaddons-6.27.0 USE="-X -debug -test"<br>[ebuild N ] kde-frameworks/kwindowsystem-6.27.0 USE="wayland -X -debug -test"<br>[ebuild N ] app-crypt/qca-2.3.10-r1 USE="ssl -botan -debug -doc -examples -gcrypt -gpg -logger -nss -pkcs11 -sasl -softstore -test"<br>[ebuild N ] kde-frameworks/karchive-6.27.0 USE="crypt zstd -debug -test"<br>[ebuild N ] kde-frameworks/kguiaddons-6.27.0 USE="dbus wayland -X -debug -test"<br>[ebuild N ] kde-frameworks/kdoctools-6.27.0 USE="nls -debug -test"<br>[ebuild N ] kde-frameworks/kcolorscheme-6.27.0 USE="-debug"<br>[ebuild N ] kde-frameworks/kcrash-6.27.0 USE="-X -debug -test"<br>[ebuild N ] kde-frameworks/knotifications-6.27.0 USE="-debug"<br>[ebuild N ] kde-frameworks/kservice-6.27.0 USE="man -debug -test"<br>[ebuild N ] kde-frameworks/kwallet-6.27.0 USE="-debug -minimal -test"<br>[ebuild N ] kde-frameworks/kwallet-runtime-6.27.0 USE="(keyring) (legacy-kwallet) man -X -debug -gpg -test"<br>[ebuild N ] kde-plasma/ksshaskpass-6.6.6 USE="-debug"
Would you like to merge these packages? [Yes/No]
lxqt-base/lxqt-openssh-askpass is next, and it needs X outright. On top of<br>that it pulls in a few KDE framework packages and a Qt built with X support,<br>which collides with the dev-qt/qtbase already on my system that was...