SSH: 공개 키 인증을 시도할 때 내 시스템이 내 개인 키를 제공하는 이유는 무엇입니까?

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

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

개인 키가 잘못되었습니다. 문자 하나가 누락되었습니다. 유효한 개인 키가 사용되면 출력이 다음과 같이 변경됩니다.

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).

관련 정보