Extraordinary year of the Boxer Rat

The year 2020 is an extraordinary New Year. It is said that something important will happen in the Year of Gengzi. Otherwise, a large-scale infectious virus will occur in the New Year of this year. This New Year is more thrilling 😂, the only point is better, now what have become quiet, the car on the road is less, less people, as if to return to the heart of the wood to write in the poem everything slowed down.

Although you stay in isolation for more than ten days, your mortgage, car loan, and payment will come as the days go by. If you don’t go to work, you will have no income, and the company will stagnate. These are things we don’t want to see. As an advantage of Internet companies compared to traditional companies, we can work remotely online without contacting people, at least we can keep the work going.

telecommuting

Almost all of our office systems are on the corporate Intranet. To work from home, you need to be at least connected to the corporate Intranet, or to operate your corporate computer. Here I used two software teamView, Sunflower. These two software can easily realize the control of the company’s computer from the computer at home, but there are still many disadvantages, such as operation delay is not smooth, and will often drop the line, need to reconnect. I am using the Intranet penetration tool FRP, which enables me to use Microsoft remote desktop. The company computer is Windows, and Microsoft remote desktop is much smoother, just like operating the computer locally. This section describes how a local MAC can penetrate a remote desktop to a Windows PC through the Intranet.

FRP Intranet penetration tool, project address, can download the release version here. It supports TCP, UDP, HTTP, and HTTPS protocols. There are two main things, a server and a client. The server must be installed on the public network server, and the client must be installed on the Intranet PC. The Intranet client sends Intranet data to the public network server, and the local PC accesses the data on the public network server to obtain Intranet computer data. The public network server feels like a proxy server.

Server Setup

Generally, the system of the public network server is Linux64-bit. You need to download the LINUx64-bit version of THE FRP, and the main files FRPS, frps.ini, and frps_full.ini. 1. Configure the frps.ini configuration file on the server.

  [common]
  bind_port = 7066
  vhost_http_port = 8089
Copy the code

Bind_port indicates the communication port between the client and the server, and vhost_http_port indicates the HTTP service port of the server. Refer to frps_full.ini and the project help documentation for more extensive configurations.

2. Run the./ FRPS -c frps.ini command to start the server

3. Set to start automatically boot on the step of FRPS command will occupy the whole of the command window, so the next thing to consider how to make it run in the background and the boot from the rev., through the vim/etc/systemd/system/FRPS. Service ordered new file and write the following content,

  [Unit]
  Description=frps daemon
  After=syslog.target  network.target
  Wants=network.target
  
  [Service]
  Type=simple
  ExecStart=/usr/loal/frp/frps -c /usr/local/frp/frps.ini
  Restart= always
  RestartSec=1min
  
  [Install]
  WantedBy=multi-user.target
Copy the code

ExecStart = systemctl start FRPS > systemctl enable FRPS > systemctl enable FRPS > systemctl enable FRPS Whether it can start by looking at the port start listening to determine whether successful, check the port listening state command netstat ano | grep, 7066 I bind port is 7066. Note: if your server is Ali Cloud, you need to open the port of the system first, and then open the port in the security group policy of Ali cloud, otherwise your server will not be able to access. For example, centos7 opens ports. Centos6 is different from centos7.

  firewall-cmd --zone=public --add-port=7066/tcp --permanent
  firewall-cmd --reload
Copy the code

Client setup

Most of the company’s computer systems are Windows, may also have MAC, but FRP does not have a MAC version of the installation package, but you can try to compile the source code under MAC, the source code is Golang. Main files FRPC, frpc.ini, frpc_full.ini. 1. Configure the client file frpc.ini.

  [common]
  server_addr = X.X.X.X
  server_port = 7066
  
  [rdp]
  type = tcp
  local_ip = 0.0. 0. 0
  local_port = 3389
  remote_port = 6000
  
  [web]
  type = http
  local_port = 8080
  custom_domains = xxx.com
Copy the code

Set sever_addr to the IP address of the computer on the public network, and server_port is the same as bind_port in frps.ini. RDP is configured for remote desktop, the default port for Windows remote desktop is 3389, and the Web is configured for HTTP communication. On the web page, custom_domains indicates the domain name bound to the public IP address. At the same time, you can configure multiple ports and Intranet computer ports. Such as

  [ssh]
  type = tcp
  local_ip = 192.1681.100.
  local_port = 22
  remote_port = 2255
Copy the code

In this way, you can SSH from home to a server on the Intranet. Note: if your server is Ali Cloud, you need to open remote_port in the system and then open the port in ali Cloud security group policy. Remote_port refers to the computer port that is used to access the Intranet.

2. Start the client. Double-click frpc.exe or run the FRPC -c frpc.ini command to start the client. If all is well with the configuration, you will see a successful connection on the client side and a connection on the server side.

3. Set the FRPC as a Windows service. Use the WinSW tool to register the FRPC as a Service in Windows. Download the latest version of Winsw, the address can be renamed to winsw.exe, put this file and frpc.exe together, then create a new Winsw.xml and write the following

  <service>
      <id>frp</id>
      <name>frp</name>
      <description>Use FRP internal penetration</description>
      <executable>frpc</executable>
      <arguments>-c frpc.ini</arguments>
      <logmode>reset</logmode>
  </service>
Copy the code

Then run the winsw install and FRPC start commands to install FRPC as a system service. After win+ R, run services. MSC to go to the service list page to find the FRP service. You can start and close the service, double-click to set the FRP service properties. 1. Change the startup type to Automatic. 2. Click restore TAB and select restart service for all failed operations to ensure that the FRPC automatically tries to connect to the FRPC again if the connection fails

Remote desktop from Mac to Windows

1 Mac You need to download the Remote login control software. You are advised to download the Microsoft Remote Desktop For Mac

2 After the installation, start the software, enter the IP address of the Internet server and the port number mapping the Intranet service, x.x.x.xx :6000, and click connect.

3 Troubleshooting If The certificate or associated chain is not valid is displayed













If “Remote Desktop Connection cannot verify the identity of the computer that you want to connect to. Try reconnecting To the Windows-based computer, or contact our administrator “error