Windows下使用ssh-add报错 Error connecting to agent: No such file or directory
Environmental Information
problem
Error when using the ssh-add
PS D:\code> ssh-add -l
Error connecting to agent: No such file or directory
Processing steps
- Ssh-agent to check whether the service starts successfully
PS D:\code> get-service ssh*
Status Name DisplayName
------ ---- -----------
Stopped ssh-agent OpenSSH Authentication Agent
- Find 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 ssh-add command to check whether success
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