Huang

Huang

Xiaomi WR30U Unlock SSH Flash OpenWrt

Last time I introduced the Xiaomi WR30U, the most cost-effective router in the hundred-yuan price range this year, equipped with an MT7981B dual-core 1.3GHz CPU, 128M flash memory, and 256M RAM. Additionally, the signal is very good, and it works well as a Mesh AP without flashing. Today, I saw that the OpenWRT community shared a method to unlock SSH without disassembling the device, so I wrote a tutorial to share.
Before we start, let's thank:

Preparation Work#

  • Xiaomi WR30U router
  • Windows computer (needs to have both Ethernet and Wi-Fi)
  • Install Python (recommended to install from Windows Store, so you don't have to manually configure environment variables)

Unlock SSH#

Configure WR30U#

Do not connect the Ethernet cable to the WR30U yet; it won't affect the computer's notification of no network. Open the backend at 192.168.31.1, and set the following in Common Settings - Internet Settings:
  • Internet Settings: DHCP, automatically configure DNS
notion image
  • Enable wireless configuration synchronization with smart gateway (will restart)
notion image
  • Set WAN port to 1 (will restart)
notion image

Configure the Computer#

notion image
Connect the computer to the existing Wi-Fi that can access the internet (not the unlocked WR30U's Wi-Fi), and then connect the computer to the WR30U using an Ethernet cable.
Open Control Panel - Network and Internet - Network and Sharing Center - Select WLAN - Click Properties - Sharing - Check the first option to allow - Confirm. At this point, the WR30U should be able to connect to the network, and the indicator light will change from yellow to blue.
notion image

Run the Script to Unlock#

Open the built-in terminal and first enter the command to install pycryptodome
Then run the script, enter python, and drag the extracted server_emulator.py file into the terminal, then press Enter to execute.
python server_emulator.py
notion image
Execution will take about a minute, and when you see Device information and finish, it means you have successfully opened SSH on WR30. The default username is root and the password is admin.

Try SSH Connection#

Now you can disconnect the Ethernet cable between the WR30U and the computer, and connect the computer to the WR30U's Wi-Fi. Do not power off or restart the WR30U, otherwise, the current SSH connection will drop, and you will need to run the script again.
In the terminal, try to SSH into the WR30U
If you see the message “WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!”, it is due to a record of connecting to another Xiaomi router before; just execute this command.
notion image
The password you enter will not be displayed; just type it in and press Enter to execute. You should see the familiar ARE U OK message. If you want to make SSH persistent, you can execute the following commands (the WR30U needs to be connected to the internet), otherwise, SSH will drop after a reboot. If you directly flash OpenWRT, you can skip this step.
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.