Skip to content

Instantly share code, notes, and snippets.

@GongT
Last active September 26, 2019 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GongT/4e9c74d6209b3c3edc97f7ba1224fbe4 to your computer and use it in GitHub Desktop.
Save GongT/4e9c74d6209b3c3edc97f7ba1224fbe4 to your computer and use it in GitHub Desktop.
Windows 10 native OpenSSH Agent

To enable ssh-agent and add private key into it:

Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent

ssh-add X:\xxx.ed25519

The permission of file X:\xxx.ed25519 need manual tweak before ssh-add:

  1. Right click X:\xxx.ed25519, click "Properties."
  2. Swtich to "Security" tab and click "Advanced"
  3. Click "Disable inheritance", and select "delete" them
  4. Delete anything left in the permission table, to make it empty.
  5. Click "Add", click "Select User or Group", type in your username, and click "OK"
  6. Click "Ok" for every dialog

Co-Op

When ssh-agent running, it listen on windows named pipe \.\pipe\openssh-ssh-agent

Windows named pipe is exact same thing as mkfifo on linux.

But on linux, ssh-agent is listening on an unix socket (more like TCP). Not on a fifo file.

So, They aren't compitable with each other.

Git has ssh executable selection builtin. To let git use native ssh.exe from windows, this is need to run once (in Git Bash):

git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment