첫 번째 지문 받기

첫 번째 지문 받기

RSA 지문에 대한 나의 이해는 그것이 기본적으로 해시 키라는 것입니다.

전달된 포트에 대한 나의 이해는 다음 섹션에 따릅니다 man ssh.

 -R [bind_address:]port:host:hostport
         Specifies that the given port on the remote (server) host is to
         be forwarded to the given host and port on the local side.  This
         works by allocating a socket to listen to port on the remote
         side, and whenever a connection is made to this port, the connec‐
         tion is forwarded over the secure channel, and a connection is
         made to host port hostport from the local machine.

SSH를 사용하여 전달된 포트에 연결할 때 RSA 키 지문 해시는 무엇입니까? 여러 시스템에서 동일한 RSA 인증 키 사용내가 묻는 이유를 설명하겠습니다.

아니면 예를 들어 아래 두 개의 지문은 실제로 무엇입니까?

  1. RSA 키 지문은 94:21:d2:fc:70:2d:8d:bb:71:30:0f:4d:52:49:01:43입니다.
  2. RSA 키 지문은 b2:5b:19:25:91:50:3c:45:73:c7:7e:4f:da:c3:f6:f3입니다.

첫 번째 지문 받기

기계 1

sshtunnel@pi_one:~ $ ssh -R 2222:localhost:22 [email protected]

일반 기계

[sshtunnel@devserver ~]$ ssh -p 2222 sshtunnel@localhost
The authenticity of host '[localhost]:2222 ([::1]:2222)' can't be established.
RSA key fingerprint is 94:21:d2:fc:70:2d:8d:bb:71:30:0f:4d:52:49:01:43.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.

두 번째 지문 받기

기계 2

sshtunnel@pi_two:~ $ ssh -R 2222:localhost:22 [email protected]

일반 기계

[sshtunnel@devserver ~]$ ssh -p 2222 sshtunnel@localhost
The authenticity of host '[localhost]:2222 ([::1]:2222)' can't be established.
RSA key fingerprint is b2:5b:19:25:91:50:3c:45:73:c7:7e:4f:da:c3:f6:f3.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
[sshtunnel@devserver ~]$

답변1

호스트의 공개 키는 다음과 같습니다 /etc/ssh/ssh_host_*_key.pub.

$ ssh localhost
The authenticity of host 'localhost (::1)' can't be established.
ECDSA key fingerprint is 60:6e:7a:10:85:a4:14:f1:37:44:88:17:29:67:b1:e1.
Are you sure you want to continue connecting (yes/no)? ^C

$ ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key
256 60:6e:7a:10:85:a4:14:f1:37:44:88:17:29:67:b1:e1 /etc/ssh/ssh_host_ecdsa_key.pub (ECDSA)

ssh-keygen( 확장자 없이 개인 키의 지문을 요청해도 상관 없으며 .pub대신 해당 공개 키를 자동으로 읽습니다.)

귀하의 경우 언급된 것은 RSA 키이므로 /etc/ssh/ssh_host_rsa_key.pub포트 전달을 사용하면 결국 호스트가 ssh연결됩니다.

최신 버전의 경우 ssh-keygen기본 출력은 키의 base64로 인코딩된 SHA256 해시입니다. 옵션 을 추가하면 -E md516진수로 인코딩된 MD5 해시가 제공됩니다(단, 이제 해시 유형을 나타내는 접두사가 있음에 유의하세요).

$ ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub
256 SHA256:4+dfNAIjGq72HL9UeNEpne8J54yj/4wFpi+/4Bv7dhQ root@... (ECDSA)
$ ssh-keygen -Emd5 -l -f /etc/ssh/ssh_host_ecdsa_key.pub
256 MD5:3c:18:e7:9c:ee:e8:6a:38:7d:74:ef:2f:a5:51:ee:1a root@... (ECDSA)

관련 정보