Win10添加ssh公钥

1,创建ssh-key

ssh-keygen.exe

2,运行ssh-agent

Start-Service ssh-agent
PS C:\Users\Administrator\.ssh> Start-Service ssh-agent
Start-Service : 由于以下错误无法启动服务“OpenSSH Authentication Agent (ssh-agent)”: 无法启动计算机“.”上的服务 ssh-a
gent。
所在位置 行:1 字符: 1
+ Start-Service ssh-agent
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

出现错误

使用管理员执行powershell

Get-Service ssh-agent

Get-Service -Name ssh-agent | Set-Service -StartupType Manual
Start-Service ssh-agent
Get-Service ssh-agent

ssh-add ~/.ssh/id_rsa

 添加成功

猜你喜欢

转载自blog.csdn.net/wfjdemmye/article/details/125435501