24

次のように動的ポート転送を使用して SSH トンネルをセットアップすることは可能ですか。

ssh-D

しかし、それは逆ですか?つまり、ローカル マシンで接続を開始し、そこで動的ポート フォワーディングを実行し、友人にブラウザをトンネルの反対側に接続させたいということです。

私の友人が上記を入力した場合、上記は完全に機能しますが、私は彼に私のマシンへの ssh アクセスを許可したくありません。彼にブラウザをプロキシさせるだけです。

4

1 に答える 1

36

openssh については、次の-Rスイッチを参照してください。

 -R [bind_address:]port:host:hostport
         Specifies that the given port on the remote (server) host is to
         be forwarded to the given host and port on the local side.  This
         works by allocating a socket to listen to port on the remote
         side, and whenever a connection is made to this port, the connec‐
         tion is forwarded over the secure channel, and a connection is
         made to host port hostport from the local machine.

より良い解決策があるかもしれませんがremotehost、次の方法で友人のコンピュータのポート 24680 に SOCKS プロキシを作成できます。まず、する

ssh -R 24680:localhost:12345 remotehost

そして、

ssh -D 12345 localhost

明らかに、両方のセッションを同時に有効にしておく必要があります。

于 2009-05-08T22:13:48.390 に答える