Eagle233-Blog

[Troubleshooting] Windows 上配置 ssh-agent 实现 Git 和 ssh 免密码


Categories Troubleshooting
Tags

91 Words   |   1 Minutes

# 启动 agent(如果未启动)
Start-Service ssh-agent

# 设置开机自动启动
Set-Service -Name ssh-agent -StartupType Automatic

打开 任务计划程序 → “创建任务”
触发器:登录时
操作:启动程序 → 程序或脚本 “C:\Program Files\PowerShell\7\pwsh.exe” → 添加参数:

-NoProfile -Command "ssh-add C:\Users\eagle\.ssh\id_ed25519"

之后执行:

git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"


Page views: Loading...  ·  Visitors: Loading...
Except where otherwise noted, original content on this site is dedicated to the public domain under CC0 1.0.
Powered by Hexo & Theme mdsuper
沪ICP备2026040813号
Search