Situation description: No fixed IP, no DDNS, no VPN, no JumpServer, pneumonia epidemic. Working from home how can I develop and debug remotely?

This was the plan,

  1. Team Viewer: The company cannot connect directly, so I use Team Viewer, but! You asked me to use this device to remotely connect to the company computer to write code, I refused, MAC and Windows keyboard layout is not the same, it is not friendly to me, and there may be business conduct detection if the SS is turned on!
  2. frp: Use FRPC to deploy Intranet penetration in the company, use VPS to do FRPS by myself, deploy Python development environment on one of my test servers in the company, and then usevscoderemote sshFunction remote development debugging is good, but also can connect terminal server ah, I can not put the relevant need of the Web page out of the proxy, this is not good.
  3. nps: use thanfrpMore powerful toolsnpsfrpSome of the functions innpsThere are,frpHe has what he doesn’t have, andnpsAlso provides web remote management function, is not flattered. Depends on thenpsTo provide thesocks5We can achieve something similarVPNThe effect of home access to the company’s entire LAN.

What is the socks

From Wikipedia

SOCKSIt is a kind of
Network Transport protocol, mainly used for the intermediate transmission of communication between the client and the Internet server. The SOCKS are “SOCKetS”
abbreviations[
1]. when
A firewallSOCKS is used when a subsequent client accesses an external server
Proxy serverThe connection. This proxy server controls the client’s access to the Internet and, if allowed, sends requests to an external server. This protocol was originally developed by David Koblas and extended to version 4 by YING-da Lee at NEC. The latest protocol is version 5, which adds support compared to the previous version
UDPValidation, and
IPv6.

According to the OSI model, SOCKS is a protocol at the session layer, located between the presentation layer and the transport layer.

Let’s cut to the chase.

The deployment of NPS

Ehang-io.github. IO/NPS /#/? Id = n…

NPS needs to be deployed on your external server with a fixed IP address, such as Ali Cloud ECS.

  1. To download the latest version of the server package on your platform (thanks for golang’s cross-platform nature) : download address

    Wget # https://github.com/ehang-io/nps/releases/download/v0.26.1/linux_amd64_server.tar.gzCopy the code
  2. Decompression package file

    # mkdir -p /opt/nps
    # tar -zxvf linux_amd64_server.tar.gz -C /opt/nps
    # cd /opt/nps
    Copy the code
  3. Modifying a Configuration File

    # vim conf/nps.conf
    Copy the code

    The modifications are as follows

    . #HTTP(S) proxy port, No startup if empty http_proxy_ip=0.0.0.0 http_proxy_port=8089 # # #default HTTPS certificate setting # https_default_cert_file=conf/server.pem # Https_default_key_file =conf/server.key ##bridge bridge_type= TCP # KCP or TCP bridge_port=10181 # Server client communication port Bridge_ip =0.0.0.0 # Public password which clients can use to connect to the server # After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file. Public_vkey =akiya # Key used when the client started in profile mode, set to empty to disable the client profile connection mode... #web web_host=a.o.com web_username=akiya #web management account web_password=akiyapwd #web management password web_port = 58080 #web management port Web_ip =0.0.0.0 web_base_URL = web_open_ssl=false web_cert_file=conf/server.pem web_key_file=conf/server.keyCopy the code
  4. Installation of NPS

    # ./nps install
    Copy the code
  5. Start the

    # nps start
    Copy the code
  6. Use with Nginx: NPS works with nginx

After the startup is complete, you can access it through a browser.

The deployment of the NPC

The NPC client is deployed on any server on the Intranet to be accessed. The current server must be able to access Intranet resources and connect to the public network.

  1. Download the latest version of the client package on the same platform as you (thank you for developing such a beautiful software) : download address

    Wget # https://github.com/ehang-io/nps/releases/download/v0.26.1/linux_amd64_client.tar.gzCopy the code
  2. Decompression package file

    # mkdir -p /opt/nps
    # tar -zxvf linux_amd64_client.tar.gz -C /opt/nps
    # cd /opt/nps
    Copy the code
  3. Modifying a Configuration File

    # vim conf/npc.conf
    Copy the code

    The modifications are as follows

    [common] server_addr=nps.akiya.com:10181 # server IP address :port conn_type= TCP # communication mode with the server (TCP or KCP) vkey=akiya # key in the server configuration file (not web) Auto_reconnection =true # crypt=true # Encrypted transmission (true or false or ignored) compress=true # Encrypted transmission (true or false or ignored) # SSH private connection [ssh_secret] mode = secret password = akiya target_addr = 192.168.1.142:22Copy the code
  4. Register with system services (boot, daemon)

    #./ NPC install-config =/config/npc.conf)Copy the code
  5. Start the

    # npc start
    Copy the code

Configuration socks5

After the NPS and NPC start up, visit the NPS Web page and you can see that the client list already has the NPC we just added

Then click the Edit button to add basic authentication

After saving, add a new SOcks5 ID to the socks5 proxy and fill it with your NPC ID. The port is your current Socks5 access port.

Connect the socks5

After the above process is completed, we can use the client tool to access the target Intranet through SOcks5.

  1. Download proxifier
  2. Registration code:

    • L6z8a-xy2j4-btz3p-zz7df-a2q9c (Portable Edition) # Installation-free version

    • 5EZ8G-c3WL5-b56yg-scXM9-6QZAP (Standard Edition) # Install version

    • P427l-9y552-5433e-8dsr3-58z68 (MAC) # MAC version

  3. Added to the proxifier

  1. Happy to connect to the Intranet, now you can happy to connect to the Intranet service from the browser or terminal




akiya789



Akiya789. Cn/articles / 20…