1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Pageant docs: improve the new OpenSSH section.

I tried setting this up on a different Windows machine today and had
some slightly different experiences. I found that in at least some
situations the command 'Include c:\...\pageant.conf' will cause
OpenSSH to emit a log message saying it's trying to open the file
'~/.ssh/c:\...\pageant.conf', which it then doesn't find. But 'Include
pageant.conf' works, because that's interpreted relative to the .ssh
directory that it's already found.

(I don't know why this happened on one Windows machine and not
another, since I only have a sample size of two. But an obvious guess
would be a bug fix in the Windows OpenSSH port, present in the version
on one of the machines I tried, and not in the other. Certainly that
failure mode looks to me like 'apply Unix instead of Windows rules to
decide what's an absolute pathname'.)

Also, clarified that all of this only works with the version of
OpenSSH that's available as a Windows optional feature, and not with
the MSYS-based one that ships with Windows git.
This commit is contained in:
Simon Tatham 2022-01-26 19:59:19 +00:00
parent f11b20156b
commit 9d687e4177

View File

@ -172,6 +172,11 @@ by the command, like this:
\S{pageant-cmdline-openssh} Integrating with Windows OpenSSH
Windows's own port of OpenSSH uses the same mechanism as Pageant to
talk to its SSH agent (Windows named pipes). This means that Windows
OpenSSH can talk directly to Pageant, if it knows where to find
Pageant's named pipe.
When Pageant starts up, it can optionally write out a file containing
an OpenSSH configuration directive that tells the Windows \c{ssh.exe}
where to find Pageant. If you include this file from your Windows SSH
@ -183,14 +188,34 @@ The option is \c{--openssh-config}, and you follow it with a filename.
To refer to this file from your main OpenSSH configuration, you can
use the \cq{Include} directive. For example, you might run Pageant
like this:
like this (with your own username substituted, of course):
\c pageant --openssh-config C:\Users\Simon\.ssh\pageant.conf
and then add a directive like this to your main \cq{.ssh\\config}
file:
and then add a directive like this to your main \cq{.ssh\\config} file
(assuming that lives in the same directory that you just put
\cw{pageant.conf}):
\c Include C:\Users\Simon\.ssh\pageant.conf
\c Include pageant.conf
\s{Note}: this technique only works with \e{Windows's} port of
OpenSSH, which lives at \cw{C:\\Windows\\System32\\OpenSSH\\ssh.exe}
if you have it installed. (If not, it can be installed as a Windows
optional feature, e.g., via Settings > Apps & features > Optional
features > Add a feature > OpenSSH Client.)
There are other versions of OpenSSH for Windows, notably the one that
comes with Windows \cw{git}. Those will likely not work with the same
configuration, because they tend to depend on Unix emulation layers
like MinGW or MSys, so they won't speak Windows native pathname syntax
or understand named pipes. The above instructions will only work with
Windows's own version of OpenSSH.
So, if you want to use Windows \cw{git} with an SSH key held in
Pageant, you'll have to set the environment variable \cw{GIT_SSH}, to
point at a different program. You could point it at
\cw{c:\\Windows\\System32\\OpenSSH\\ssh.exe} once you've done this
setup \dash but it's just as easy to point it at Plink!
\S{pageant-cmdline-keylist} Starting with the key list visible