1

I'm running PuTTY's pageant v0.78, which supports named pipes on Windows, per https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/pageant-named-pipe.html.

My question is... how do I find out the name of the pipe that pageant is using?

neubert
  • 6,863
  • 35
  • 76
  • 138

1 Answers1

2

Start Pageant with the option --openssh-config pageant.conf. It will write an OpenSSH-compatible configuration file to the specified path, which you can later Include from your main OpenSSH config file or read from other tools:

{~\.ssh} > cat .\pageant.conf
IdentityAgent \\.\pipe\pageant.User.ba27892<...>825bc78

{~\.ssh} > cat .\config
Include ~/.ssh/pageant.conf

(The generated config unfortunately doesn't quite work with Windows OpenSSH, which expects backslashes to be quoted somehow.)

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • That seems to work - thanks! That said, everytime I do `./pageant --openssh-config pageant.conf` I get the same UUID bit at the end. Is that some sort of UUID associated with the Windows user you're logged in as? If so then I feel like there might be an easier way to get the pipe name? And does pageant add this as an environmental value somewhere? ssh-agent on Linux creates SSH_AUTH_SOCK as an environmental variable, for example. – neubert Nov 26 '22 at 19:23
  • I don't remember the exact details, but it's based on a hash of your user ID somehow. Environment variables aren't global (neither on Windows nor Linux), so even ssh-agent cannot just "create" them. Either it outputs the contents of the environment variable to stdout, to be picked up by the parent (which is very similar to what Pageant does, minus the file) or it needs to directly start some program with that environment variable as a child. Unlike putting ssh-agent in xinitrc, though, you can't start the entire Windows GUI _through_ Pageant – so having it write out a file is the only option. – u1686_grawity Nov 26 '22 at 19:51