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