以下の例では、チャンネル番号は何に対応していますか?サーバーには何がありますか?クライアント側には何がありますか?
$ ssh -L1570:127.0.0.1:8899 root@thehost
Password:
Last login: Fri Aug 9 13:08:44 2013 from theclientip
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
You have new mail.
# channel 2: open failed: administratively prohibited: open failed
channel 3: open failed: administratively prohibited: open failed
channel 2: open failed: administratively prohibited: open failed
SSH クライアントは Windows 7 で実行され、サーバーにはポート 8899 で実行される Tomcat サーバーがあります。
Tomcatはリモートシステムの127.0.0.1でリッスンしないので、コマンドをポートフォワーディングに変更することはssh -L1570:thehostpublicip:8899 root@thehost
問題ありません。だから、ポート転送がサーバー上で正常に動作しているようです。
私のsshd設定ファイルには、次の2行が含まれています。
# Port forwarding
AllowTcpForwarding yes
# If port forwarding is enabled, specify if the server can bind to INADDR_ANY.
# This allows the local port forwarding to work when connections are received
# from any remote host.
GatewayPorts yes
Tomcat以外のプロセスのポート転送を設定しようとしていますが、上記のようなエラーメッセージが表示され、エラーメッセージの意味を理解したいと思います。
ベストアンサー1
~からSSHプロトコル文書、チャンネル情報:
すべての端末セッション、転送された接続などはチャネルです。どちらでもチャンネルを開くことができます。複数のチャネルが1つの接続に多重化されます。
チャネルは両端の数字で識別されます。関連するチャネルの数は、各側で異なる場合がある。チャネルを開く要求には、送信者のチャネル番号が含まれます。他のチャネル関連メッセージには、そのチャネル受信者のチャネル番号が含まれる。
チャネルは流れが制御される。ウィンドウスペースが利用可能であることを示すメッセージが受信されるまで、データをチャネルに送信しないでください。
フォワードポート
コマンドがよさそうです。接続しようとしているサービスが動作しており、接続を受け付けていますか?チャネルエラーは、これが真ではないことを示すようです。
私のアクティブチャンネルは何ですか?
アクティブな接続がある場合は、ssh
次のキーの組み合わせを使用してヘルプを入手できます。
Shift+~次にShift+?
$ ~?
Supported escape sequences:
~. - terminate connection (and any multiplexed sessions)
~B - send a BREAK to the remote system
~C - open a command line
~R - Request rekey (SSH protocol 2 only)
~^Z - suspend ssh
~# - list forwarded connections
~& - background ssh (when waiting for connections to terminate)
~? - this message
~~ - send the escape character by typing it twice
(Note that escapes are only recognized immediately after newline.)
debug2: channel 2: written 480 to efd 8
その後、このキーの組み合わせを使用してアクティブチャンネルのリストを取得できます。
Shift+~次にShift+#
$ ~#
The following connections are open:
#2 client-session (t4 r0 i0/0 o0/0 fd 6/7 cc -1)
debug2: channel 2: written 93 to efd 8