ssh-agentの登録鍵一覧

表題の通り。単なるメモ。

■ 環境

  • Mac OSX El Capitan

■ ssh-add

踏み台を経由して別サーバにアクセスをするようにしている。その際、鍵を`ssh-agent`に登録している。登録している鍵の一覧を取得するには下記である。

$ ssh-add -l
2048 SHA256:XXXXXX...XXXXXXX /Users/withsin/.ssh/example.pem (RSA)
$

鍵を削除するには`-d`をつければ良いらしいのだが下記のように削除ができない。

$ ssh-add -d /Users/withsin/.ssh/example.pem
Bad key file /Users/withsin/.ssh/example.pem: No such file or directory
$

ファイルは確かにあるのであるが…。

$ ls -l /Users/withsin/.ssh/example.pem
-rw-------@ 1 withsin  staff  1696  8  1  2016 /Users/withsin/.ssh/example.pem
$

仕方ないので全消しをやってみる。

$ ssh-add -D
All identities removed.
$
$ ssh-add -l
The agent has no identities.
$

以上。