LoginSignup
Pkun
@Pkun

Are you sure you want to delete the question?

If your question is resolved, you may close it.

Leaving a resolved question undeleted may help others!

We hope you find it useful!

SSH コマンドのデバッグログで鍵を確認する

でしょうか?### 解決したいこと
以下のサイトで
https://ormcat.net/blog/20210509_github-denied-publickey/#github-%E3%81%B8-ssh-%E6%8E%A5%E7%B6%9A%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86%E3%81%8A%E3%81%95%E3%82%89%E3%81%84
以下の文がある場所の事を実行を試してみました

『ssh コマンドは v オプションを付けることでデバッグログが出力されます。
つまりこうです。』

$ ssh -vT git@github.com
以下は上の文の箇所の写真なんですが、
2022-08-27_22h25_22.png

『ズラズラーとログが出てきますが、見るところは identity file だけです。』
とあるんですが2022-08-27_22h24_002.png
上の写真を見るとなんですが「identity file」
がかなりたくさんあるんですが、これは一番下の行のやつが最新のものになるんでしょうか?
debug1: identity file /c/Users/yuuit/.ssh/id_rsa type 0
debug1: identity file /c/Users/yuuit/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ed25519 type 3
debug1: identity file /c/Users/yuuit/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/yuuit/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_xmss type -1
debug1: identity file /c/Users/yuuit/.ssh/id_xmss-cert type -1
debug1: identity file /c/Users/yuuit/.ssh/id_dsa type -1
debug1: identity file /c/Users/yuuit/.ssh/id_dsa-cert type -1

あと、identity fileがこんなにたくさんあると混乱するので消したいんですが、どうすれば消す事ができるのでしょうか?
ed25519だけが欲しいとしたらdebug1: identity file /c/Users/yuuit/.ssh/id_ed25519_sk-cert type -1
この文でしょうか?ed25519の後ろに続く文字
_sk-cert type -1
の文字は、なんなんでしょうか?
分かる方どうかよろしくお願いしますm(_ _)m

0

1Answer

これは一番下の行のやつが最新のものになるんでしょうか?

順番に意味はないはずです。

_sk-cert type -1
の文字は、なんなんでしょうか?

type が-1になっているファイルは存在しません。 ssh コマンドがそのファイルを使おうと探したが見つからなかった、というログです。 type が0以上なら存在します。ログを見ると存在するのは以下の2つだけですね。

debug1: identity file /c/Users/yuuit/.ssh/id_rsa type 0
debug1: identity file /c/Users/yuuit/.ssh/id_ed25519 type 3

_sk-cert が後ろについているものは普段使わないので気にしなくていいです。

identity fileがこんなにたくさんあると混乱するので消したいんですが、どうすれば消す事ができるのでしょうか?

普通のファイルと同じように消してください。たとえば rm ~/.ssh/id_rsa を実行します。ただし identity file つまり秘密鍵ファイルは SSH 接続に必要です。普段使っているものを消すと当然接続できなくなるので慎重に行ってください。

1

Comments

  1. @Pkun

    Questioner
    やっと少しずつ分かってきました(^ー^)ありがとうございます!

Your answer might help someone💌