LoginSignup
2
3

More than 5 years have passed since last update.

ssh-add -dで`No such file or directory`と言われる場合

Posted at

ssh-addで登録した鍵を個別に削除したい場合、例えばawsの用にpemファイルしかない場合に

Bad key file .ssh/xxxx.pem: No such file or directory

のようにエラーが出ることがある。この場合、同じディレクトリに公開鍵無いことが問題なので、以下のように同じディレクトリに公開鍵を生成すると上手くいくようになる。

$ ssh-keygen -y -f ~/.ssh/xxx.pem > ~/.ssh/xxx.pem.pub
$ ssh-add -d ~/.ssh/xxx.pem
Identity removed: .ssh/xxx.pem (.ssh/xxx.pem.pub)
2
3
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
2
3