Skip to content

Support for ssh authentication with security keys (like Yubikey)#262

Open
robertpenz wants to merge 6 commits into
TabularisDB:mainfrom
robertpenz:main
Open

Support for ssh authentication with security keys (like Yubikey)#262
robertpenz wants to merge 6 commits into
TabularisDB:mainfrom
robertpenz:main

Conversation

@robertpenz
Copy link
Copy Markdown

With this patch Tabularis allows ssh to prompt for a PIN to unlock the security key. It's tested it on Fedora 43.

<div className="flex items-center gap-2 mt-1">
<input
type="checkbox"
id="ssh-prompt-toggle"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Duplicate element ID ssh-prompt-toggle. The same ID is also used in SshConnectionsModal.tsx. If both modals exist in the DOM simultaneously, clicking the <label htmlFor="ssh-prompt-toggle"> will target the wrong checkbox, and it violates HTML uniqueness constraints. Consider prefixing the ID with a modal-specific identifier (e.g., new-conn-ssh-prompt-toggle).

<div className="flex items-center gap-2">
<input
type="checkbox"
id="ssh-prompt-toggle"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Duplicate element ID ssh-prompt-toggle. The same ID is also used in NewConnectionModal.tsx. If both modals exist in the DOM simultaneously, clicking the <label htmlFor="ssh-prompt-toggle"> will target the wrong checkbox, and it violates HTML uniqueness constraints. Consider prefixing the ID with a modal-specific identifier (e.g., ssh-conn-prompt-toggle).

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 28, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/components/modals/NewConnectionModal.tsx 1439 Duplicate element ID ssh-prompt-toggle — also used in SshConnectionsModal.tsx, which can break label associations if both modals are in the DOM
src/components/modals/SshConnectionsModal.tsx 566 Duplicate element ID ssh-prompt-toggle — also used in NewConnectionModal.tsx, which can break label associations if both modals are in the DOM
Other Observations (not in diff)

No issues found in unchanged code.

Files Reviewed (17 files)
  • src-tauri/src/commands.rs — 0 issues
  • src-tauri/src/export_import_tests.rs — 0 issues
  • src-tauri/src/models.rs — 0 issues
  • src-tauri/src/ssh_tunnel.rs — 0 issues
  • src/components/modals/NewConnectionModal.tsx — 1 issue
  • src/components/modals/SshConnectionsModal.tsx — 1 issue
  • src/i18n/locales/de.json — 0 issues
  • src/i18n/locales/en.json — 0 issues
  • src/i18n/locales/es.json — 0 issues
  • src/i18n/locales/fr.json — 0 issues
  • src/i18n/locales/it.json — 0 issues
  • src/i18n/locales/ja.json — 0 issues
  • src/i18n/locales/ru.json — 0 issues
  • src/i18n/locales/zh.json — 0 issues
  • src/utils/connections.ts — 0 issues
  • src/utils/credentials.ts — 0 issues
  • src/utils/ssh.ts — 0 issues

Fix these issues in Kilo Cloud


Reviewed by kimi-k2.6-20260420 · 5,324,461 tokens

debba added 2 commits June 3, 2026 16:13
SSH_ASKPASS_REQUIRE=force alone depends on a system askpass helper
(ssh-askpass, ksshaskpass, seahorse, ...) being installed. Many setups
do not ship one — e.g. Arch or minimal Linux installs, macOS, Windows —
so enabling the passphrase/PIN prompt there made ssh fail without any
visible prompt.

Tabularis now acts as its own askpass helper:

- ssh re-executes the Tabularis binary as SSH_ASKPASS; a thin client
  mode forwards the prompt to the running app over a private local
  socket (unix socket chmod 600; TCP loopback + auth token on Windows)
- the app shows a native modal: secret/PIN entry, yes/no confirmation,
  or a "touch your security key" notification that auto-dismisses once
  ssh confirms user presence
- the tunnel readiness timeout pauses while a prompt is pending, so PIN
  entry cannot time the connection out
- falls back to the previous SSH_ASKPASS_REQUIRE=force behaviour when
  the app context is unavailable

Covered by unit tests for the wire protocol, a server round-trip over a
unix socket, and the frontend prompt queue hook.
@debba
Copy link
Copy Markdown
Collaborator

debba commented Jun 3, 2026

Thanks for this PR — the feature is very welcome!

While testing it on Arch Linux + GNOME we hit a gap: SSH_ASKPASS_REQUIRE=force relies on a system askpass helper being installed, and many setups don't have one (the compiled-in default /usr/lib/ssh/ssh-askpass doesn't exist unless a package like openssh-askpass/ksshaskpass provides it — and macOS/Windows ship none at all). On those systems enabling the option made the connection fail with no visible prompt, which is hard to diagnose.

Since most users won't have an askpass helper installed, the simplest and most portable approach seemed to be reimplementing the askpass prompt as an in-app modal, so I pushed a commit (dacbdb7) on top of your work that makes Tabularis act as its own askpass helper:

  • ssh re-executes the Tabularis binary as SSH_ASKPASS; a thin client mode forwards the prompt to the running app over a private local socket (unix socket chmod 600, TCP loopback + auth token on Windows)
  • the app shows a native modal for the three OpenSSH prompt types: secret (passphrase / security-key PIN), confirm (yes/no), and the SSH_ASKPASS_PROMPT=none notification ("Confirm user presence for key …"), which auto-dismisses once ssh detects the touch
  • the tunnel readiness timeout is paused while a prompt is pending, so typing the PIN can't time the connection out
  • if the app context isn't available it falls back to your original SSH_ASKPASS_REQUIRE=force behaviour

Tested here with a passphrase-protected key (prompt → passphrase → tunnel up), plus unit tests for the wire protocol, a server round-trip, and the frontend prompt queue.

I don't have a security key at hand for the full FIDO2 flow — could you confirm that with this commit your Yubikey still works as expected on Fedora 43 (PIN prompt in the app modal + touch notification)? Thanks!

@robertpenz
Copy link
Copy Markdown
Author

Nice, I can test it only in about 3 weeks - hope that's ok.

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.

2 participants