Posted in: IT

红米路由器AX5开启SSH的方法

上个月在网上看到了路由器开启SSH的方法。在家里的红米AX5上尝试了一下成功。然而今天发现连不上了:

ssh: connect to host 192.168.31.1 port 22: Connection refused

高度怀疑是固件自动更新了(现在是1.0.33),于是重新设置一下。由于网络原帖写得比较乱,所以在这里整理一下,分为两步:

第一步:开启SSH

http://192.168.31.1/cgi-bin/luci/;stok=<STOK>/api/misystem/set_config_iotdev?bssid=Xiaomi&user_id=longdike&ssid=-h%3B%20nvram%20set%20ssh_en%3D1%3B%20nvram%20commit%3B%20sed%20-i%20's%2Fchannel%3D.*%2Fchannel%3D%5C%22debug%5C%22%2Fg'%20%2Fetc%2Finit.d%2Fdropbear%3B%20%2Fetc%2Finit.d%2Fdropbear%20start%3B

第二步:改密码

http://192.168.31.1/cgi-bin/luci/;stok=<STOK>/api/misystem/set_config_iotdev?bssid=Xiaomi&user_id=longdike&ssid=-h%3B%20echo%20-e%20'admin%5Cnadmin'%20%7C%20passwd%20root%3B

然后马上登陆ssh,再修改密码。

路由器的/etc/os-release如下:

 NAME="OpenWrt"
 VERSION="18.06-SNAPSHOT"
 ID="openwrt"
 ID_LIKE="lede openwrt"
 PRETTY_NAME="OpenWrt 18.06-SNAPSHOT"
 VERSION_ID="18.06-snapshot"
 HOME_URL="http://openwrt.org/"
 BUG_URL="http://bugs.openwrt.org/"
 SUPPORT_URL="http://forum.lede-project.org/"
 BUILD_ID="unknown"
 LEDE_BOARD="ipq60xx/MiWiFi"
 LEDE_ARCH="arm_cortex-a7"
 LEDE_TAINTS="no-all busybox"
 LEDE_DEVICE_MANUFACTURER="OpenWrt"
 LEDE_DEVICE_MANUFACTURER_URL="http://openwrt.org/"
 LEDE_DEVICE_PRODUCT="Generic"
 LEDE_DEVICE_REVISION="v0"
 LEDE_RELEASE="OpenWrt 18.06-SNAPSHOT unknown"

禁止路由器自动升级固件

红米路由器很诡异,无法从web端去设置这选项。后来去Telegram群里问了一下才知道,要安装MiWiFiapp去设置。

Comments (4) on "红米路由器AX5开启SSH的方法"

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注