Prerequisite: A public IP address must be available

  • Frequent business trips require good equipment such as a desktop
  • Small companies or teams can start with a small cost to meet basic needs
  • Servers are cheap in remote areas like your home

Target computer Settings

Set the mainboard

Asus press F2 or Del Advanced -> to open PCI-E/PCI wake up

Set the nic

Control Panel -> All Control Panel Items -> Device Manager -> Network Adapter -> Properties -> Advanced -> Magic Packet Wake up (On) Power Management -> All check (” Allow computer to turn off this device to save power “check off)

Obtain the Intranet IP address and MAC address of the target machine

ipconfig/all

The physical address is the MAC address. MAC :08-62-66-86-8C-29 IP :192.168.1.7

LAN wakeonLAN wake up

Sudo apt-get install wakeonlan wakeonlan -I 192.168.1.7 -p 9 08:62:66 6:88 6:8c :29

Wsl2, Raspberry PI 100% effective sudo wakeonlan 08:62:66 6:86:8C:29

LAN CMD Wake up

Download from www.depicus.com/wake-on-lan…

Exe into C:\Windows\System32 format: Wolcmd [MAC address] [IP address] [subnet mask] [port number(default port number 7)]

086266868 c29 wolcmd 192.168.1.7 255.255.255.0

Service penetration configuration for the public network

Server Configuration

Gz -c /usr/local/sudo mv /usr/local/frp_0.36.2_linux_amd64 /usr/local/frp_0.36.2_linux_amd64 /usr/local/frp_0.36.2_linux_amd64 /usr/local/frp_0.36.2_linux_amd64 sudo cd /usr/local/frp/ rm -f frpc* vim frps.ini

[common] bind_port = 6868 nohup./ FRPS -c./frps.ini & #

Configure the self-start script

vim systemd/frps.service

  • Change to the corresponding path address

ExecStart=/usr/local/frp/frps -c /usr/local/frp/frps.ini

cp /usr/local/frp/systemd/frps.service /etc/systemd/system/ \

  • Configuring startup

systemctl daemon-reload

systemctl enable frps

systemctl start frps

Raspberry PI configuration

  • Configuring the root Role

whoami

sudo passwd root

Enabling user root

sudo passwd –unlock root

Example Set SSH to allow login

sudo sed -i “s/^#PermitRootLogin.*/PermitRootLogin yes/g” /etc/ssh/sshd_config

Restarting the SSH Service

sudo systemctl restart ssh

Apply the same bash configuration to the root user for the current user

sudo cp ~/.bashrc /root/.bashrc

Login as root \

SSH [email protected] sudo wakeonlan 08:62:666:86:8C :29 ssh-p 6969 [email protected]

  • The raspberry PI Intranet penetrates SSH

The mkdir FRP wget github.com/fatedier/fr…

Note: Raspberry PI is arm, centos is AMD64, do not use HTTPS to load much faster

  • Raspberry PI client configuration

Gz -c /usr/local/sudo mv /usr/local/frp_0.36.2_linux_arm /usr/local/frp CD run the following command to run the following command: sudo tar -zxvf frp_0.36.2_linux_arm.tar /usr/local/frp/ rm -f frps*

VI fails to switch vim

apt-get remove vim-common

apt-get install vim

vim frpc.ini

[common] server_ADDR = 159.75.79.24 Public IP server_port = 6868 The same as bind_port in the frps.ini server. [SSH] type = TCP LOCAL_IP = 0.0.0.0 Internal IP local_port = 22 SSH port remote_port = 6969 SSH port for accessing internal USe_encryption = true Use_compression = trueCopy the code
  • Raspberry PI boot up

Vim frpc.service ExecStart=/usr/local/frp/frpc -c /usr/local/frp/frpc.ini ExecReload=/usr/local/frp/frpc reload  -c /usr/local/frp/frpc.ini cp frpc.service /lib/systemd/system/ systemctl enable frpcCopy the code
  • Restart the view

reboot

systemctl status frpc

Remote desktop

Target Win10 configuration user

1. Configure the Account Control panel -> User Accounts -> set the login password of the current account (the interface of the remote login account is the interface of the current account to log in to Win, only one place can be logged in at a time) 2. Open remote desktop Computer -> Properties -> Allow remote links to this computer -> Add User 3. Link to the test

MSTSC ->192.168.1.7:3389 Enter the new user name and password

Remote operation including shutdown; Behind to do is to penetrate to this address, Internet access!

Win10 Local penetration configuration

  • Client Configuration

    # frpc.ini [common] server_addr = XX.xx.xx. xx Destination server port server_port = XXX [RDP] type = TCP local_IP = 0.0.0.0 local_port =  3389 remote_port = 9696 ``Copy the code
  • WIN10 boot from start

Exe rename to winsw.exe new winsw.xml \

<service> <! -- Unique identifier of the service --> <id> FRP </ ID > <! -- Name of the service --> <name> FRPC </name> <! FRPC client This service uses FRPC for Intranet penetration </description> <! D:\ FRP \frpc.exe</executable> <! --> <arguments>-c frpc.ini</arguments> <! < onFailure action="restart" delay="5 SEC "/> <! < onFailure action="restart" delay="5 SEC "/> <! -- logmode --> <logmode>append</logmode> <! -- Specify the log file directory (relative to the executable configuration path) --> < logPath >logs</ logPath > </service>Copy the code

winsw.exe install

Remote Access to MSTSC Intranet 192.168.1.7:3389 XX.xx.xx. xx:9696(Remote port through mapping)

Add configuration WIN10 service tool command: Exe uninstall // Starts the service winsw.exe start // stops the service winsw.exe stop // Restarts the service winsw.exe Exe status win+r>services. MSC

Reference:

Imba97. Cn/archives / 44… Imba97. Cn/archives / 50… www.bilibili.com/video/av967… Blog.csdn.net/wang7402096… Windows Remote Desktop ICheer. me/201910/1101… Blog.csdn.net/qq_42846807… Blog.csdn.net/u011976966/… Raspberry PI penetrates SSH blog.csdn.net/qq_34013719… Blog. Readgroup. Cn/post / 81 set root www.jianshu.com/p/fd7280bd8… Boot www.linuxprobe.com/frp-onboot…. Win10 startup FRP blog.csdn.net/atmosphere_… www.jianshu.com/p/eb9eb4a88…