SSH key with a passphrase does not work #77

Open
opened 2026-10-11 18:26:58 +02:00 by Tirsvad · 0 comments
Owner

Problem

An SSH key that is protected by a passphrase does not work with create-project.sh. The same key without a passphrase works.

Probable cause (not yet confirmed by a reproduction)

Both SSH calls run with -o BatchMode=yes, which switches off every passphrase prompt:

  • src/lib/preflight.sh test_gitea_ssh: the SSH test fails, so STATE[is_ssh_ok] stays 0 and origin falls back to HTTPS (or the run reports "check your SSH key").
  • src/lib/git.sh git_project: git over SSH fails at once when the key is not already loaded in an agent. The error text in src/lib/localproject.sh then says "check your SSH key".

So a passphrase key only works when it is already loaded in ssh-agent. Nothing in the output tells the user that.

To decide when the issue is planned

  • Keep BatchMode=yes and detect the case: say that the key needs a passphrase and tell the user to run ssh-add first.
  • Or allow one passphrase prompt in the preflight only.
  • Document the behaviour in the README (Security decisions / Error handling).

Notes

Collected as an open issue on purpose: no milestone yet. More issues are collected before milestones are made.

## Problem An SSH key that is protected by a passphrase does not work with `create-project.sh`. The same key without a passphrase works. ## Probable cause (not yet confirmed by a reproduction) Both SSH calls run with `-o BatchMode=yes`, which switches off every passphrase prompt: - `src/lib/preflight.sh` `test_gitea_ssh`: the SSH test fails, so `STATE[is_ssh_ok]` stays 0 and `origin` falls back to HTTPS (or the run reports "check your SSH key"). - `src/lib/git.sh` `git_project`: git over SSH fails at once when the key is not already loaded in an agent. The error text in `src/lib/localproject.sh` then says "check your SSH key". So a passphrase key only works when it is already loaded in `ssh-agent`. Nothing in the output tells the user that. ## To decide when the issue is planned - Keep `BatchMode=yes` and detect the case: say that the key needs a passphrase and tell the user to run `ssh-add` first. - Or allow one passphrase prompt in the preflight only. - Document the behaviour in the README (Security decisions / Error handling). ## Notes Collected as an open issue on purpose: no milestone yet. More issues are collected before milestones are made.
Tirsvad added the Kind/Bug label 2026-10-11 18:26:58 +02:00
Sign in to join this conversation.