Skip to main content

Command Palette

Search for a command to run...

SSH + Root Access on Xiaomi Mi Router Nano / Lite / Youth

Updated
1 min read
A

A Software Engineer passionate about public good projects and making technology to serve society en masse.

Obtaining ssh access along with root is as simple as flashing the Developer ROM and setting the root password via a POST request. However, the Developer ROM is completely in Chinese. Thus, it is advisable to have a copy of Google Chrome installed for automatic translation. Let’s get started.

  1. Download the Official Developer ROM

  2. Visit http://192.168.31.1, login and manually upgrade to the Official Developer ROM. Ignore any warning regarding downgrading.

  3. Wait for 5-7 minutes. After the router is back on again, you need to set a root password to be able to log in. Login to the router and copy the “stok” but from the address bar. Open up a shell and,

curl -d "oldPwd=your_admin_pass&newPwd=desired_root_pass" \
"http://192.168.31.1/cgi-bin/luci/;stok=<stok from browser url>/api/xqsystem/set_name_password"
  1. Now a response should indicate a code. If the code is set to 0, you have successfully set your password. Otherwise if you receive a text in chinese, translate that to figure out what is wrong.

  2. Happy Hacking!

More from this blog

Aniruddha Adhikary

23 posts

Hi there! Ani here. I am a Polyglot Software Engineer hacking away from the sunny shores of Singapore 🇸🇬.

Whatever you read here, are my opinions in my personal capacity.