Ssh uses port forwarding to implement SOCKS5 proxy

Source: Internet
Author: User
Tags ssh server

Currently, openssh is widely used in linux.

Ssh-related options:
  • -V
    Show version:
    Ssh-V
    OpenSSH_6.6.1p1 Ubuntu-2ubuntu2, OpenSSL 1.0.1f 6 Jan 2014

  • -F
    Enter the password and enter the background mode (Requests ssh to go to background just before command execution .)

  • -N
    Do not execute a remote command. This is useful for just for warding ports (protocol version 2 only ).)

  • -D
    Socket5 proxy (Specifies a local "dynamic" application-level port forwarding. Currently the SOCKS4 and SOCKS5 protocols are supported, and ssh will act as a SOCKS server .)

  • -L
    Tcp forwarding (Specifies that the given port on the local (client) host is to be forwarded to the given host and port on the remote side .)

  • -C
    Compression is desirable on modem lines and other slow connections, but will only slow down things on fast networks. the compression algorithm is the same used by gzip)

Create a SOCKS5 proxy:

Ssh-f-N-D bindaddress: port name @ server

  • Bindaddress: specify the bound IP address.
  • Port: specifies the listening port.
  • Name: ssh server login name
  • Server: ssh server address

Example:
Ssh-f-N-D 127.0.0.1: 1080 [email protected]
In this way, the SOCKS5 proxy is created.

Use SOCKS5 proxy

Example:

  • Chrome:
    Chrome needs to use the command to specify the SOCKS5 proxy:
    Google-chrome -- proxy-server = "socks: // 127.0.0.1: 1080"

  • Firefox:
    In preferences => advanced => Network-> connection-> Settings, check Manual proxy configuration and clear other items. Set SOCKS Host to 127.0.0.1 and port to 1080, check Remote DNS (to prevent local DNS contamination ),.

  • Others, please search for specific articles about their respective configurations:

  • Use proxy plug-ins such as switchysharp

  • Set the global proxy in the agent that comes with the system

  • Use other SOCKS clients to implement proxy, such as redsocks

Reference
  • SSH tunneling and port forwarding and intranet penetration
  • OpenSSH official website

Ssh uses port forwarding to implement SOCKS5 proxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.