
サーバーに接続しようとしています。そのサーバーにログインするための秘密鍵を受け取り、それを id_rsa に追加しました。しかし、クライアントは id_rsa.pub ではなくそれを公開鍵として渡そうとし続けます。これは id_rsa.pub が ssh_config ファイルに含まれていないためでしょうか?
サーバー接続試行
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
SSH 構成ファイル (ID セクション)
root@etoorlan4c:~/.ssh# cat /etc/ssh/ssh_config
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
~/.ssh/ の内容
root@etoorlan4c:~/.ssh# ls
authorized_keys id_rsa id_rsa.pub known_hosts
答え1
秘密キーが無効です。1 文字が欠落しています。有効な秘密キーを使用すると、出力は次のように変わります。
debug1: Offering RSA public key: root@etoorlan4c
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: sshkey.private
debug3: sign_and_send_pubkey: RSA SHA256:jmMyCOppv3KKkRgiHI4s5h3I7LwyCgms8uSG06KClQ4
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 52
debug1: Authentication succeeded (publickey).
Authenticated to [remoteHost]([xxx.xxx.xxx.xxx]:22).