이것은 해결하기 쉬운 문제여야 하지만 어떤 이유에서인지 나에게는 효과가 없습니다.
ssh vps
잘 작동합니다 (인증 키를 사용합니다)
다음 명령을 사용하여 터널을 설정했습니다.
ssh -C2TNv -D 8080 vps
그런 다음 Firefox 네트워크 설정을 수정합니다.
- 수동 구성
- http 프록시: localhost, 포트: 8080
- 모든 프로토콜에 이 프록시 서버를 사용하세요
- 양말 v5
- 정보:구성
- network.proxy.socks_remote_dns: 참
터미널 출력:
$ ssh -C2TNv -D 8080 vps
OpenSSH_6.0p1, OpenSSL 1.0.1a 19 Apr 2012
debug1: Reading configuration data /home/ting/.ssh/config
debug1: /home/ting/.ssh/config line 47: Applying options for vps
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to vps.server.com [1.1.1.1] port 22.
debug1: Connection established.
debug1: identity file /home/ting/.ssh/id_rsa type 1
debug1: identity file /home/ting/.ssh/id_rsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1 pat OpenSSH_5*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0
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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA <removed>
debug1: Host 'vps.server.com' is known and matches the RSA host key.
debug1: Found key in /home/ting/.ssh/known_hosts:10
debug1: ssh_rsa_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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/ting/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Enabling compression at level 6.
debug1: Authentication succeeded (publickey).
Authenticated to vps.server.com ([1.1.1.1]:22).
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.
그런 다음 Firefox, SSH 출력을 사용하여 사이트를 방문해 봅니다.
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug1: channel 2: new [dynamic-tcpip]
debug1: channel 2: free: dynamic-tcpip, nchannels 3
debug1: Connection to port 8080 forwarding to socks port 0 requested.
debug1: channel 2: new [dynamic-tcpip]
debug1: channel 2: free: dynamic-tcpip, nchannels 3
프록시가 작동하는 것처럼 보임에도 불구하고 Firefox를 사용하여 사이트를 방문하면 "연결이 재설정되었습니다"라는 오류가 반환됩니다.
답변1
-D를 사용한 SSH 명령은 괜찮습니다(따라서 SOCKS는 HTTP를 통해 SOCKS에 연결하는 것만 터널링하므로 정렬해야 함).
나는 좋은 결과를 얻습니다.
curl --socks5 127.0.0.1:8080 http://blah
하지만 그렇게 하면 얻을 수 있는 것과 똑같은 잘못된 결과가 나옵니다.
curl --proxy 127.0.0.1:8080 http://blah
따라서 Firefox는 마치 HTTP 프록시인 것처럼 연결하고 있습니다.
파이어폭스 창을 보면
수동 구성 예
"모든 프로토콜에 이 프록시 서버 사용"을 선택했다고 하셨는데, 그건 완전히 잘못된 조치입니다! SOCKS 프록시를 입력하려고 하는데 그렇게 하면 SOCKS 상자가 null/회색으로 표시되고 HTTP 프록시만 입력할 수 있습니다.
그러니 체크하지 마세요.
그리고 양말 프록시 IP를 입력하세요.
127.0.0.1,localhost 에 대한 프록시가 없다고 표시된 부분을 제거하세요. 그렇게 말하면 기본값입니다.
답변2
컬을 통한 연결을 확인하려면 플래그를 사용할 수도 있습니다 -I -v
(HTTP 헤더만 가져오고 더 많은 내용의 출력을 얻으려면).
이러한 플래그가 선택되고 컬 연결이 이루어지면 출력 문자열에 다음과 같은 내용이 표시됩니다.
* Rebuilt URL to: http://www.google.ru/
* Trying ::1...
* 87
* 245
* 198
* 44
* Connected to localhost (::1) port 8080 (#0)
연결할 수 없는 경우:
* Rebuilt URL to: http://www.google.ru/
* Trying ::1...
* connect to ::1 port 8080 failed: Connection refused
SSH 연결이 있는 다른 터미널 탭에는 다음과 같은 내용이 표시됩니다.
debug1: channel 2: new [dynamic-tcpip]
debug1: channel 2: free: direct-tcpip: listening port 9999 for 87.245.198.44 port 80, connect from ::1 port 55034 to ::1 port 8080, nchannels 3