How do I set up a local SOCKS proxy that tunnels traffic through SSH?

pzkpfw

Assume I have access to an SSH server that supports tunneling, and I am on a PC that is running *ubuntu, how do I set up a local SOCKS proxy that tunnels the traffic through that SSH server before reaching the Internet?

pzkpfw

The ssh binary that you use when you connect to a server running ssh supports running a SOCKS proxy out of the box, with the -D flag. Example:

ssh -D 1337 -f -C -q -N user@remote -p 22
  • -D 1337 tells ssh to launch a SOCKS server on port 1337 locally.
  • -f forks the process into the background.
  • -C Turns on compression.
  • -q enables "Quiet mode", since the purpose here is only to tunnel we don't really care about error output and such.
  • -Nssh명령이 전송되지 않음을 알려줍니다 ( -f이를 지정하지 않으면 불평).
  • -p사용할 포트를 지정합니다. 분명히 이것은 22로 기본 설정되어 있으므로 위의 진술은 무의미하지만 명확성을 위해 포함되었습니다.

SOCKS 서버가 실행 중일 때 애플리케이션 (일반적으로 웹 브라우저)이 일반 인터넷이 아닌 로컬 SOCKS 프록시에 연결을 시도하고 있는지 확인하기 만하면됩니다.

Firefox 29 (여기에 예제로 설명 됨)에서는 메뉴 (오른쪽 상단에있는 세 개의 소시지)로 이동 한 다음 환경 설정> 고급> 네트워크> (연결)> 설정 ...으로 이동하여이를 수행합니다. SOCKS 필드를 작성하십시오! 프록시가 동일한 시스템에 있기 때문에 동일한 시스템에서 설정 한 포트를 사용 localhost하거나 127.0.0.1다시 가리킬 수 있습니다 .

DNS 요청도 터널링해야하는 경우 (그렇지 않은 경우 DNS 조회를 통해 방문하려는 웹 사이트가 표시됨) "원격 DNS"를 확인하거나에서 전체 구성을 수행 할 수 있습니다 about:config. 마지막 경우에는 그것을 열고 다음 값을 설정하십시오.

network.proxy.socks : 127.0.0.1
network.proxy.socks_port : 1337
network.proxy.socks.remote_dns : true
network.proxy.socks_version : 5
network.proxy.type : 1

터널링에서 특정 도메인이나 사이트를 제외하려면이 설정이 필요할 수도 있습니다.

network.proxy.no_proxies_on : localhost, 127.0.0.1, 192.168.0.0/24, .yourcompany.com

이 답변은 프랑스에서 작성되었지만 스웨덴을 통해 터널링되었습니다. :)

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How do I set up a server for SSH?

분류에서Dev

How do I set up SSH to transfer files from my local machine to a shared server with rsync?

분류에서Dev

How to create a SOCKS proxy with ssh?

분류에서Dev

How do I set up an email server?

분류에서Dev

How do I route my internet through a SSH tunnel?

분류에서Dev

How to redirect all traffic except SSH to one local port with iptables

분류에서Dev

How can I reach a remote ssh server through my http proxy (80 port)?

분류에서Dev

Debian Linux: How can I expose a SOCKS proxy as a HTTP proxy for the purpose of HTTP/HTTPS requests?

분류에서Dev

How do I set up a bash alias for a common working folder?

분류에서Dev

How do I get add-apt-repository to work through a proxy?

분류에서Dev

is it possible to check whether a local socks proxy works with shell script?

분류에서Dev

Is it possible to use a SOCKS5 proxy for the macOS terminal on a local machine?

분류에서Dev

How do I turn on nanosecond precision when capturing live traffic?

분류에서Dev

How do I view my website traffic for a GAE product?

분류에서Dev

How do I set up live audio streams to a DLNA compliant device?

분류에서Dev

How do I set up Emacs on Linux to read/send mail from Gmail?

분류에서Dev

How do I set up an iAd that works for both iOS 5 and 6? and if possible compatible with all iOS

분류에서Dev

How do I set up a second display via DVI/viewport with a Lenovo T420S?

분류에서Dev

How do I set up Launchy's Runner plugin to launch Everything search

분류에서Dev

How do I set up a multi-project solution in C++?

분류에서Dev

Flycheck and Clutter - how can I set it up?

분류에서Dev

How to bypass proxy with either VPN or Socks5

분류에서Dev

How do I make a requesocks request with socks5 username and password?

분류에서Dev

Set Up SSH Agent for git

분류에서Dev

Is it possible to redirect ssh traffic (not forward), How?

분류에서Dev

Redirect ALL packets from eth1 & eth2 through a SOCKS proxy

분류에서Dev

How do I allow SFTP with a password BUT not SSH?

분류에서Dev

How do I remove an SSH forwarded port

분류에서Dev

su another user through ssh with a local script

Related 관련 기사

  1. 1

    How do I set up a server for SSH?

  2. 2

    How do I set up SSH to transfer files from my local machine to a shared server with rsync?

  3. 3

    How to create a SOCKS proxy with ssh?

  4. 4

    How do I set up an email server?

  5. 5

    How do I route my internet through a SSH tunnel?

  6. 6

    How to redirect all traffic except SSH to one local port with iptables

  7. 7

    How can I reach a remote ssh server through my http proxy (80 port)?

  8. 8

    Debian Linux: How can I expose a SOCKS proxy as a HTTP proxy for the purpose of HTTP/HTTPS requests?

  9. 9

    How do I set up a bash alias for a common working folder?

  10. 10

    How do I get add-apt-repository to work through a proxy?

  11. 11

    is it possible to check whether a local socks proxy works with shell script?

  12. 12

    Is it possible to use a SOCKS5 proxy for the macOS terminal on a local machine?

  13. 13

    How do I turn on nanosecond precision when capturing live traffic?

  14. 14

    How do I view my website traffic for a GAE product?

  15. 15

    How do I set up live audio streams to a DLNA compliant device?

  16. 16

    How do I set up Emacs on Linux to read/send mail from Gmail?

  17. 17

    How do I set up an iAd that works for both iOS 5 and 6? and if possible compatible with all iOS

  18. 18

    How do I set up a second display via DVI/viewport with a Lenovo T420S?

  19. 19

    How do I set up Launchy's Runner plugin to launch Everything search

  20. 20

    How do I set up a multi-project solution in C++?

  21. 21

    Flycheck and Clutter - how can I set it up?

  22. 22

    How to bypass proxy with either VPN or Socks5

  23. 23

    How do I make a requesocks request with socks5 username and password?

  24. 24

    Set Up SSH Agent for git

  25. 25

    Is it possible to redirect ssh traffic (not forward), How?

  26. 26

    Redirect ALL packets from eth1 & eth2 through a SOCKS proxy

  27. 27

    How do I allow SFTP with a password BUT not SSH?

  28. 28

    How do I remove an SSH forwarded port

  29. 29

    su another user through ssh with a local script

뜨겁다태그

보관