ホストサーバーの公開鍵についてどのような情報を確認できますか?

ホストサーバーの公開鍵についてどのような情報を確認できますか?

管理者は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.

質問:ホストサーバーの公開鍵についてどのような結論を出すことができますか?

foob​​ar管理者が私の公開鍵をインストールしていないと結論付けるのに十分な情報がありますか?

公開鍵をインストールしたが破損している場合は、-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".サーバーが提供された最後のキーを受け入れたことを示します。

おすすめ記事