SCPは機能しますが、SSHは機能しません(Wi-Fi経由)。

SCPは機能しますが、SSHは機能しません(Wi-Fi経由)。

オフィスでWi-Fiを使用すると、SCPを使用してサーバーとファイルをコピーできますが、何らかの理由でSSHが応答しなくなります。ただ停止し、何も印刷せず、ctrl-c終了できません。端末ウィンドウを閉じる必要があります。

LANに接続すると、すべてがうまく機能します。何が起こっているのかを調べる方法についてのアイデアはありますか?

ベストアンサー1

ついに問題の原因を見つけました。これは、ワイヤレスで接続すると、ルータがTCP接続を維持するメッセージをブロックするためです(図を参照)。

ssh my_server -o TCPKeepAlive=no私のすべての問題を解決しました。うん!

ドキュメントから:

TCPKeepAlive
  Specifies whether the system should send TCP keepalive messages
  to the other side. If they are sent, death of the connection or
  crash of one of the machines will be properly noticed.  However,
  this means that connections will die if the route is down tem-
  porarily, and some people find it annoying.  On the other hand,
  if TCP keepalives are not sent, sessions may hang indefinitely on
  the server, leaving "ghost" users and consuming server resources.

  The default is "yes" (to send TCP keepalive messages), and the
  server will notice if the network goes down or the client host
  crashes.  This avoids infinitely hanging sessions.

  To disable TCP keepalive messages, the value should be set to
  "no".

おすすめ記事