1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Error connecting to agent: No such file or directory の解決方法

Posted at

Error log

Error connecting to agent: No such file or directory

原因

  • SSHエージェントが実行されていない
  • SSHの設定が適切に設定されていない

解決策

1. SSHの確認と開始

サービスの状態確認

  1. PowerShell を管理者で実行
  2. 以下のコマンドを実行して、ssh-agent サービスの状態を確認
Powershell
 Get-Service ssh-agent

サービスの開始

サービスが停止している場合は、以下のコマンドで開始

Powershell
 Start-Service ssh-agent

サービスの自動起動設定

毎回手動で開始する手間を省くために、サービスを自動起動に設定

Powershell
Set-Service -Name ssh-agent -StartupType Automatic

2. SSHキーの追加

サービスが実行されていることを確認したら、再度SSHキーを追加

Powershell
ssh-add C:\Users\hogehoge\.ssh\id_rsa_foobar

3. OpenSSHがインストールされているか確認

Powershell
ssh -V

ない場合、OpenSSHをインストールする

Powershell
dd-WindowsCapability -Online -Name OpenSSH.Client
# 管理者特権で行う

4. PowerShellの再起動

これでうごくはず。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?