You need gateway 3(mgl03) connected to MiHome. And also ip and gateway token.
Via XiaomiGateway3 component.
You must input in the 'Open Telnet command' field(as it is without changing anything):
{"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}
php-miio (https://github.com/skysilver-lab/php-miio)
You may need to change id.
php miio-cli.php --ip GW_IP --token GW_TOKEN --sendcmd '{"id":123,"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}}'python-miio (https://github.com/rytilahti/python-miio)
miiocli device --ip GW_IP --token GW_TOKEN raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ; passwd -d admin ; echo enable > /sys/class/tty/tty/enable; telnetd"}'Login: admin
Password is empty
After opening telnet, it is better to install custom firmware (only for Xiaomi Gateway 3 mgl03).
Read here: https://github.com/zvldz/mgl03_fw/tree/main/firmware#the-easy-way
Open telnet command should also work with:
- lumi.gateway.mgl03 - Mi Smart Home Hub
 - lumi.gateway.acn01 - Aqara Hub M1S CN
 - lumi.gateway.aeu01 - Aqara Hub M1S EU
 - lumi.aircondition.acn05 - Aqara Air Conditioning Controller P3
 - lumi.gateway.sacn01 - Smart USB Wall Outlet Hub
 
You need gateway E1 connected to MiHome. And also ip and gateway token.
Via XiaomiGateway3 component, version 2+.
You must input in the 'Open Telnet command' field(as it is without changing anything):
{"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; /bin/riu_w 101e 53 3012; telnetd"}}
php-miio (https://github.com/skysilver-lab/php-miio)
You may need to change id.
php miio-cli.php --ip GW_IP --token GW_TOKEN --sendcmd '{"id":123,"method":"set_ip_info","params":{"ssid":"\"\"","pswd":"123123 ; /bin/riu_w 101e 53 3012; telnetd"}}'python-miio (https://github.com/rytilahti/python-miio)
miiocli device --ip GW_IP --token GW_TOKEN raw_command set_ip_info '{"ssid":"\"\"","pswd":"123123 ;  /bin/riu_w 101e 53 3012 ; telnetd"}'Login: root
Password is empty
I am not author, I just tested and improved and published.
Enabling
telnetdPermanently on lumi.gateway.mgl001I found a solution to enable
telnetdpermanently on thelumi.gateway.mgl001gateway.This script creates a custom initialization file that starts
telnetdpermanently after a reboot.Spoiler How It Works
The Linux OS initializes using the
/etc/init.d/rcSscript, which includes the following logic at the end:By default, the
/data/scripts/post_init.shfile does not exist, so the system executesfw_manager.sh -r.The
fw_manager.shscript does not include atelnetdlaunch command.By creating
/data/scripts/post_init.shwith the following content:telnetd & fw_manager.sh -rtelnetd &- runstelnetdin the background.fw_manager.sh -r- executes the default program, maintaining the original system behavior.Since the
if [ -x ${CUSTOM_POST_INIT} ]; thencondition checks for the executable bit, we must make the script executable withchmod +x /data/scripts/post_init.sh.Verify the executable permissions:
The
xflags confirm the file is executable.