How IT

언제든지 물어보세요.

컨텐츠로 건너뛰기
  • 홈
  • Unix
  • Apple
  • Java
  • Android
  • C#
  • C++

ssh : id_rsa는 작동하지 않지만 이름을 바꾸면 작동합니다. 그것은 단지

~ / .ssh 폴더에이 id_rsa가 있습니다. 그러나 그것은 단지 인증하지 않습니다. 복사하여 id_rsa가 아닌 다른 이름으로 바꾸면 작동합니다.

[qfan@mycomputer .ssh]$ ls -al id_rsa id_rsa_good
-rw------- 1 qfan qfan 1766 Dec  3 18:35 id_rsa
-rw------- 1 qfan qfan 1766 Nov 20 19:43 id_rsa_good
[qfan@mycomputer .ssh]$ sha1sum id_rsa id_rsa_good
8cc7f68170038b184bba0541be7d105bb36f7d11  id_rsa
8cc7f68170038b184bba0541be7d105bb36f7d11  id_rsa_good
[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa
qfan@localhost's password:

[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa_good
Enter passphrase for key 'id_rsa_good':
Last login: Tue Dec  3 18:46:46 2013 from 127.0.0.1
[qfan@mycomputer ~]$ exit
logout
Connection to localhost closed.

“ssh localhost -i id_rsa”가 실패하고 ssh가 일반 비밀번호 로그인을 요청하기 시작합니다.

나는 -vvv를 사용했고 로그의 차이점은 다음과 같습니다.

[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa_good -vvv 2> log1_good.txt
Enter passphrase for key 'id_rsa_good':

[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa -vvv 2> log2_bad.txt
qfan@localhost's password:

[qfan@mycomputer .ssh]$ diff log1_good.txt log2_bad.txt
7c7
< debug3: Not a RSA1 key file id_rsa_good.
---
> debug3: Not a RSA1 key file id_rsa.
41c41
< debug1: identity file id_rsa_good type -1
---
> debug1: identity file id_rsa type 1
81,82c81,82
< debug2: dh_gen_key: priv key bits set: 126/256
< debug2: bits set: 533/1024
---
> debug2: dh_gen_key: priv key bits set: 127/256
> debug2: bits set: 503/1024
90c90
< debug2: bits set: 506/1024
---
> debug2: bits set: 539/1024
103c103
< debug2: key: id_rsa_good ((nil))
---
> debug2: key: id_rsa (0x7f953ea96f90)
136,138c136,145
< debug1: Trying private key: id_rsa_good
< debug1: PEM_read_PrivateKey failed
< debug1: read PEM private key done: type <unknown>
---
> debug1: Offering public key: id_rsa
> debug3: send_pubkey_test
> debug2: we sent a publickey packet, wait for reply
> debug3: Wrote 368 bytes for a total of 1477
> debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
> debug2: we did not send a packet, disable method
> debug3: authmethod_lookup password
> debug3: remaining preferred: ,password
> debug3: authmethod_is_enabled password
> debug1: Next authentication method: password
[qfan@mycomputer .ssh]$

키 파일에서 암호 문구를 제거하려고 시도했지만 id_rsa라는 이름으로 여전히 작동하지 않습니다.

그래서 무엇이 잘못 되었습니까?

——-편집하다——-

[qfan@mycomputer .ssh]$ file id_rsa
id_rsa: ASCII text
[qfan@mycomputer .ssh]$ cat id_rsa |head -n2
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED



답변

이유를 찾았습니다. id_rsa.pub같은 .ssh폴더 에있는 내 파일은 다른 ID 파일에 속하는 공개 키입니다. 때 id_rsa.pub일치하지 않는 경우 id_rsa,자동으로 실패합니다. id_rsa.pub파일을 제거하거나 이동 하면 id_rsa작동합니다.


답변


이 글은 Server 카테고리에 분류되었고 login, rsa, ssh 태그가 있으며 소장 마님에 의해 2022-04-10에 작성되었습니다.

글 네비게이션

← 다음 소수를 찾을 프로그램 사람이 2^74,207,281 − 1$ 100.000를 ConEmu : “cls [ENTER]”를 실행하는 키보드 단축키 붙여 넣기 위해 매크로를 생성 한 →

태그

  • android
  • apt
  • bash
  • boot
  • c#
  • c++
  • code-golf
  • command-line
  • debian
  • firefox
  • git
  • google-chrome
  • hard-drive
  • html
  • java
  • keyboard
  • linux
  • mac
  • macos
  • math
  • memory
  • microsoft-excel
  • mysql
  • networking
  • performance
  • permissions
  • python
  • r
  • regression
  • security
  • shell
  • sql-server
  • ssh
  • string
  • terminal
  • ubuntu
  • unity
  • usb
  • vim
  • virtualbox
  • windows
  • windows-7
  • windows-8
  • windows-10
  • windows-xp

최신 글

  • Windows에서 파티션 크기를 조정 한 후 APFS 파티션이 손실 됨 00 80
  • App Store에서 El Capitan을 강제로 다시 다운로드 하시겠습니까? 업데이트 된 플래시 드라이브 설치 프로그램을 빌드하기
  • 기존 시스템에 부팅 드라이브로 SSD 추가 백업에 큰 관심이 없습니다. 내가 걱정하는 것은이
  • geoJSON featureCollection에 properties 요소를 갖는 것이 유효합니까?
  • 추세를 식별하기 위해 신호 처리 원리를 신중하게 사용 매우 시끄러운 장기 데이터에서 추세를

카테고리

  • Android
  • Apple
  • C#
  • C++
  • cooking
  • cs
  • cstheory
  • diy
  • drupal
  • electronics
  • emacs
  • Gis
  • Git
  • Html
  • Java
  • Javascript
  • magento
  • photo
  • Python
  • raspberrypi
  • scicomp
  • Server
  • Software
  • Sql
  • stats
  • Superuser
  • ubuntu
  • Unix
  • vi
  • webapps
  • webmasters
  • wordpress
  • 게임개발
  • 코딩
Proudly powered by WordPress
Go to mobile version