호스트 서버의 공개 키에 대해 어떤 정보를 확인할 수 있나요?

호스트 서버의 공개 키에 대해 어떤 정보를 확인할 수 있나요?

관리자는sftp.foobar.com다음 작업이 완료되었습니다.

  1. 내 공개 키 수신을 확인했습니다.(id_rsa.pub)
  2. 그 서버의 호스트 이름을 알려주세요(sftp.foobar.com)
  3. SSH/sftp 연결에 사용할 사용자 ID를 알려주세요(foo_user1)

이 내 꺼야.ssh/config 항목

Host foobar
 
 identityfile  id_rsa
 hostname      sftp.foobar.com
 user          foo_user1
 port          22 # I've also tried 2222 

$sftp -vvv foobar


 OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /home/foo_client/.ssh/config
debug1: /home/foo_client/.ssh/config line 332: Applying options for foobar
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "sftp.foobar.com" port 2222
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to sftp.foobar.com [21.01.148.55] port 2222.

  #The session hangs and I CTRL-C to terminate command.


  $ssh 21.01.148.55

# I get no response
# I get neither userid nor password prompt.

질문:호스트 서버의 공개 키에 대해 어떤 결론을 내릴 수 있습니까?

foobar 관리자가 내 공개 키를 설치하지 않았다고 결론을 내릴 만큼 충분한 정보가 있습니까?

공개 키를 설치했지만 손상된 경우 -vvv 출력에서 ​​추가 정보를 얻을 수 있습니까?

답변1

공개 키에 대해서는 아무것도 결정할 수 없습니다. 방화벽에 의해 연결이 차단되었습니다.

SSH의 디버그 출력은 방화벽 문제를 진단하는 데 도움이 되지 않습니다. 문제는 TCP보다 낮은 수준에서 발생합니다. 이는 컴퓨터, 로컬 네트워크, 서버의 로컬 네트워크 또는 서버 자체에 문제가 있을 수 있습니다. tcptraceroute도움이 될 수도 있습니다.

다음은 성공적으로 연결할 때 표시되는 몇 가지 관련 메시지가 포함된 몇 가지 샘플 출력입니다.


debug1: Connecting to sftp.foobar.com [21.01.148.55] port 2222.
debug1: Connection established.
debug1: identity file /home/foo_client/.ssh/id_rsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.4
debug1: Will attempt key: /home/from_client/.ssh/id_rsa 
debug1: Next authentication method: publickey
debug1: Offering public key: …
Authenticated to sftp.foobar.com (21.01.148.55:2222) using "publickey".

(메시지를 약간 편집하여 호스트 이름의 정확한 형식이 잘못되었을 수 있습니다.)

주목할 가치가 있습니다.

  • debug1: Connecting클라이언트가 TCP 연결을 시작하는 시간입니다.
  • debug1: Connection established.TCP 연결이 설정되었음을 나타냅니다. 연결이 이 지점에 도달하지 못했습니다.
  • debug1: Remote protocol version …이는 서버가 SSH 프로토콜을 사용하여 응답했다는 첫 번째 표시입니다.
  • debug1: Will attempt key:클라이언트가 찾은 키를 나타냅니다.
  • debug1: Next authentication method: publickey클라이언트가 서버와 협상한 후 공개 키 인증을 시도하기로 결정했음을 나타냅니다.
  • debug1: Offering public key: …클라이언트가 현재 이 키를 사용하여 인증을 시도하고 있음을 나타냅니다.
  • Authenticated to sftp.foobar.com (21.01.148.55:2222) using "publickey".서버가 제공된 마지막 키를 수락했음을 나타냅니다.

관련 정보