漆予 Chiyuu

Windows 配置 GnuPG

发布日期:

Configure SSH (Auth agent)

Configure the following files 👇

gpg.conf

use-agent

gpg-agent.conf

# open ssh support
enable-win32-openssh-support
use-standard-socket

# default-cache-ttl 3600
# max-cache-ttl 3600

## allow use cli pinentry
# gpg --pinentry-mode loopback <do-something>
allow-loopback-pinentry

sshcontrol

gpg -k --with-keygrip
  1. must use unix-end line \n
  2. should have a new-line character at the end if it contain just a single keygrip

Configure the environment variable 👇

SSH_AUTH_SOCK="\\.\pipe\openssh-ssh-agent

Configure startup

create a shortcut from <path>\gnupg\bin\gpg-connect-agent.exe and put it into C:\Users\<user>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Note:

Test

run ssh-add -L and ssh -T git@github.com

Configure git (Sign Commit)

gpg.conf

use-agent

git config

[user]
	signingkey = <key-id>
[commit]
	gpgsign = true
[gpg]
	program = <path>\\gnupg\\bin\\gpg.exe # indicate your gpg program path