生成新的 SSH 密钥

Bash
1
ssh-keygen -t rsa -b 4096 -C "[email@example.com]"

将 SSH 密钥添加到 ssh-agent

Bash
1
2
Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
Bash
1
ssh-add C:\Users\[User]\.ssh\id_rsa

移除 SSH 密钥

Bash
1
2
3
4
# 查看已加载的密钥列表
ssh-add -l
# 移除密钥
ssh-add -d C:\Users\[User]\.ssh\id_rsa