
自宅のラップトップに SSH をインストールしましたが、問題なく動作しています。トンネルを設定しました。
$ ssh -p 443 -C2TNv -D 8080 [email protected]
Firefoxの設定:
manual config:
SOCKS; port 8080
V5
about:config:
network.proxy.socks_remote_dns: true
端末出力:
OpenSSH_5.9p1, OpenSSL 0.9.8t 18 Jan 2012
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to me.no-ip.org [] port 443.
debug1: Connection established.
debug1: identity file /home/me/.ssh/id_rsa type -1
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: identity file /home/me/.ssh/id_dsa type -1
debug1: identity file /home/me/.ssh/id_dsa-cert type -1
debug1: identity file /home/me/.ssh/id_ecdsa type -1
debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 [email protected]
debug1: kex: client->server aes128-ctr hmac-md5 [email protected]
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: <removed>
debug1: Host '[me.no-ip.org]:443' is known and matches the host key.
debug1: Found key in /home/me/.ssh/known_hosts:2
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/me/.ssh/id_rsa
debug1: Trying private key: /home/me/.ssh/id_dsa
debug1: Trying private key: /home/me/.ssh/id_ecdsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
[email protected]'s password:
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (password).
Authenticated to me.no-ip.org ([removed]:443).
debug1: Local connections to LOCALHOST:8080 forwarded to remote address socks:0
debug1: Local forwarding listening on ::1 port 8080.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 8080.
debug1: channel 1: new [port listener]
debug1: Requesting [email protected]
debug1: Entering interactive session.
その後、どのウェブサイトにアクセスしても、「プロキシサーバーは接続を受け入れていません」と表示されます。
お知らせ下さい。
答え1
Putty 内からトンネル設定を変更する必要がありました。バブルのダイナミックと IPv4 をチェックする必要がありましたが、現在は正常に動作しています。
答え2
sshd
リモート エンドで を実行し、Web サーバーではなくそれに ssh で接続する必要があります。
$ ssh -C2TNv -D8080 [email protected]
実際に接続するホストとポートは、各 SOCKS 要求の一部としてブラウザによって指定されます。
で SOCKS トンネルを設定するとssh -D
、次のようになります。
- アプリ (この場合はブラウザ) は、指定したローカル socks ポートに接続します。
- ローカルで実行されている ssh プログラムは SOCKS サーバーとして機能し、ブラウザーから要求されたホストとポートを取得します。
- ローカルは、指定したホスト(この場合は)上で実行されている
ssh
リモートに、要求されたホストとポートへの接続を開くように要求します。sshd
me.no-ip.org
- ローカル
ssh
とリモートは、sshd
ブラウザによって確立されたローカル接続とによって確立されたリモート接続の間でトラフィックを転送するために、それらの間にトンネルを設定しますsshd
。これがトンネルです。