-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
None
-
None
-
None
-
Severity 3 - Minor
When first accessing an SSH server the server's key is not cached and the user is prompted to accept it. Previously when this happened with PuTTY (plink.exe), it would fail and we would detect the prompt, ask the user to accept the key, then run a separate invocation of plink to save the key in the registry before re-trying.
As of the latest version, the initial plink call actually hangs waiting for user input instead of failing. The user must manually run plink on the command line to be able to accept the key. This is unintuitive and the user may not realise this is the workaround.
One way to make plink fail rather than hang on the prompt would be to pass the `-batch` flag to the call. However, this is problematic:
- You cannot pass flags to `GIT_SSH`
- Using `GIT_SSH_COMMAND` instead does allow you to pass flags, but this doesn't work with custom ports (typical for Bitbucket Server). This is because plink requires that ports are specified with `-P` instead of `-p`, and git only does this substitution when it detects that `GIT_SSH` is set to plink, not with `GIT_SSH_COMMAND`.
- Using a wrapper script (a .cmd so that it's launchable from both Bash and Windows hooks/filters) would also work but again suffers from the same problem with the lack of `-P` port argument conversion. Git only converts to `-P` if the target of GIT_SSH is exactly "plink.exe" or "plink". Any other name will not trigger the conversion.
A possible option might be to write a replacement plink.exe which is just in a different folder and which calls the original plink but with the `-batch` flag. This is somewhat confusing though. Raising this here for future discussion as it has impacted a recent customer support request (as a side effect).