SSH:为什么我的系统在尝试公钥身份验证时会提供我的私钥?

Inf*_*5ek 7 ssh

尝试连接到服务器。我收到了一个用于登录到我添加到 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
Run Code Online (Sandbox Code Playgroud)

SSH 配置文件(身份部分)

root@etoorlan4c:~/.ssh# cat /etc/ssh/ssh_config
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)

~/.ssh/ 的内容

root@etoorlan4c:~/.ssh# ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts
Run Code Online (Sandbox Code Playgroud)

Inf*_*5ek 6

私钥无效。其中缺少一个字符。使用有效私钥时,输出更改如下:

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).
Run Code Online (Sandbox Code Playgroud)