sshでポート転送を開始できません


0

私は192.168.1.8でsshdを次のように起動します:

sudo /usr/sbin/sshd -ddd

次に、192.168.1.5:1234へのSSHトンネルを開こうとしましたが、できません。以下がその内容sshd -dddです。

debug1: server_input_channel_open: confirm direct-tcpip
debug3: channel 1: waiting for connection
debug1: channel 1: connected to 192.168.1.5 port 1234
debug2: channel 1: read<=0 rd 10 len 0
debug2: channel 1: read failed
debug2: channel 1: close_read
debug2: channel 1: input open -> drain
debug2: channel 1: ibuf empty
debug2: channel 1: send eof
debug2: channel 1: input drain -> closed
debug2: channel 1: rcvd close
debug2: channel 1: output open -> drain
debug3: channel 1: will not send data after close
debug2: channel 1: obuf empty
debug2: channel 1: close_write
debug2: channel 1: output drain -> closed
debug2: channel 1: send close
debug2: channel 1: is dead
debug2: channel 1: garbage collecting
debug1: channel 1: free: direct-tcpip, nchannels 2
debug3: channel 1: status: The following connections are open:
  #0 server-session (t4 r256 i0/0 o0/0 fd 11/9 cc -1)
  #1 direct-tcpip (t4 r257 i3/0 o3/0 fd 10/10 cc -1)

したがって、接続することはできますが、読み取りは失敗します。それでも、これを行うと(失敗する読み取りなしで)接続できます(192.168.1.8):

ssh -p 1234 username@192.168.1.5

192.168.1.8での直接ssh接続ができないのに、なぜ192.168.1.8でトンネルが失敗するのですか?

トンネルを作成するためにPuTTYを使用しています。


「SSHトンネルを開く」ときに入力する正確なコマンドは何ですか?
Jakuje

トンネルをオンデマンドで動的に作成するためにPuTTYを使用しています。PuTTYは、要求を送信し、応答を読み取るSOCKS5サーバーを作成します。次に、作成したPHPスクリプトを使用してSOCKS5サーバーに接続します。これにより、PuTTYにトンネルを要求します。そして、上で示したように、PuTTYはトンネルを作成しています。google.com:80へのトンネルを正常に作成でき、HTTP要求を送信して応答を読み取ることはできますが、192.168.1.5:1234の場合はできません。少なくとも、SSHサーバー識別子(SSH-2.0-whatever)を取得する必要がありますが、そうではありません。
ノイバート

サーバーで転送を有効にしていますか?SOCKSプロキシは動的転送です。あなたはそれを選びましたか?
-Jakuje

superuser.com/q/983503/172193ごとにPuTTYの動的転送をチェックしました。サーバーで有効になっているかどうかについては...まあ、SOCKS5プロキシにgoogle.comへの接続を開いてからHTTPリクエストを送信するように指示すると、応答が返されます。そのため、有効になっているようです。私が行うとsudo vim /etc/ssh/sshd_configしてやる/Forward私が見る唯一のものですX11Forwarding yes。表示されませんAllowTcpForwardingが、多分それはクライアントのみの設定です
。-ノイバート
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.