Windows: SSH-add Error connecting to agent: No such file or directory [Solved]

Use ssh-add under Windows to report Error connecting to agent: No such file or directory

<a name=”mqFEu”></a>

Environmental information

  • Operating system: windows 10
  • Terminal: Windows PowerShell <a name=”pXQ8f”></a>

<a name=”EGV6M”></a>

problem

Error when using ssh-add

PS D:\code> ssh-add -l
Error connecting to agent: No such file or directory

<a name=”kxXYH”></a>

Processing steps

  • Check whether the ssh-agent service started successfully
PS D:\code> get-service ssh*

Status   Name               DisplayName
------   ----               -----------
Stopped  ssh-agent          OpenSSH Authentication Agent
  • Found that the ssh-agent service status is stopped, start the service
PS D:\code> Set-Service -Name ssh-agent -StartupType Manual
PS D:\code> Start-Service ssh-agent
  • Execute the ssh-add command to check whether it is successful
PS D:\code> ssh-add -l
2048 SHA256:Dw8iD5trSzInnsmmDpaXBusdfL2K3wM3b+GMulKNHbAU C:\Users\Administrator\.ssh\xxx-pc (RSA)
2048 SHA256:Mb4qKSueS8bqNALm3423eD98KdTIuEwnLvfVWTNPCusg C:\Users\Administrator\.ssh\yyy (RSA)
2048 SHA256:nyLi89QHTYFMr97sM0cG9I6sBfA82GpR9Os2WF0HlwA C:\Users\Administrator\.ssh\id_rsa (RSA)
  • problem solved

Similar Posts: