-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload new file: Redmi-AX6000 开启 SSH.md via simpread
- Loading branch information
Showing
1 changed file
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [mp.weixin.qq.com](https://mp.weixin.qq.com/s/WqjYuQeFmTVe2YcZQzzfmw) | ||
> Redmi-AX6000 是一款高性能路由器。本文我们简单地看看如何开启 SSH 安装第三方软件吧。 | ||
![](https://mmbiz.qpic.cn/mmbiz_png/Xb3L3wnAiatgWniaK7ic0E0GWZ4L7x2xgm8nN0HuibPpnd1KOD2r26QQl0rg3c92aOMK3aBKLLl8laHLNj8yVHj8yA/640?wx_fmt=png&from=appmsg) | ||
|
||
环境 | ||
== | ||
|
||
* 系统固件`1.0.67`稳定版 | ||
|
||
|
||
![](https://mmbiz.qpic.cn/mmbiz_png/Xb3L3wnAiatgWniaK7ic0E0GWZ4L7x2xgm8sPjliaP918usg79ZuzNCKdkesZkNTPqNdpSQ8GDYUJBpLNSuT8uoGzA/640?wx_fmt=png&from=appmsg) | ||
|
||
获取 TOKEN | ||
======== | ||
|
||
登录小米路由器后台,在浏览器的地址栏中获取 token 秘钥并记录。token 秘钥为下图地址栏中蓝色部分数值。 | ||
|
||
![](https://mmbiz.qpic.cn/mmbiz_png/Xb3L3wnAiatgWniaK7ic0E0GWZ4L7x2xgm8J2SmkH1oTCqtUtdX6Dia7PVQwYxOPbKbBAaDhoKNNxiaxqbwRkC9FhUQ/640?wx_fmt=png&from=appmsg)打开浏览器,复制下面的内容到地址栏,并替换 `{TOKEN}` | ||
|
||
``` | ||
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20zz%3D%24%28dd%20if%3D%2Fdev%2Fzero%20bs%3D1%20count%3D2%202%3E%2Fdev%2Fnull%29%20%3B%20printf%20%27%A5%5A%25c%25c%27%20%24zz%20%24zz%20%7C%20mtd%20write%20-%20crash%20%3B%20 | ||
``` | ||
|
||
我的替换后如上。将替换好的值复制到浏览器请求,如果显示 `{"code":0}` 如上返回内容则表示成功。 | ||
|
||
**重启** | ||
|
||
同样打开浏览器,复制下面的内容到地址栏,并替换 {TOKEN} | ||
|
||
``` | ||
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3b%20reboot%20%3b%20 | ||
``` | ||
|
||
永久开启 telnet | ||
=========== | ||
|
||
待路由器重启完成后,重新进入路由器管理后台,获取新的 {token};之后打开浏览器,复制下面的内容到地址栏,并替换`{token}`。 | ||
|
||
``` | ||
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3B%20bdata%20set%20telnet_en%3D1%20%3B%20bdata%20set%20ssh_en%3D1%20%3B%20bdata%20set%20uart_en%3D1%20%3B%20bdata%20commit%20%3B%20 | ||
``` | ||
|
||
之后请再次执行通过浏览器请求重启并等待设备重启完成。 | ||
|
||
``` | ||
http://192.168.31.1/cgi-bin/luci/;stok={token}/api/misystem/set_sys_time?timezone=%20%27%20%3b%20reboot%20%3b%20 | ||
``` | ||
|
||
开启 SSH | ||
====== | ||
|
||
创建 Telnet 会话,链接设备。`无用户名和密码` | ||
|
||
![](https://mmbiz.qpic.cn/mmbiz_png/Xb3L3wnAiatgWniaK7ic0E0GWZ4L7x2xgm8Z487476SkODIonxy6AthI2ULVBZpNWCs3VG9kpKfnpMLMD7hH6ykUA/640?wx_fmt=png&from=appmsg) | ||
|
||
接下来,分别执行下面命令; | ||
|
||
``` | ||
echo -e 'admin\nadmin' | passwd root | ||
nvram set ssh_en=1 | ||
nvram set telnet_en=1 | ||
nvram set uart_en=1 | ||
nvram set boot_wait=on | ||
nvram commit | ||
sed -i 's/channel=.*/channel="debug"/g' /etc/init.d/dropbear | ||
/etc/init.d/dropbear restart | ||
mkdir /data/auto_ssh | ||
cd /data/auto_ssh | ||
curl -O https://fastly.jsdelivr.net/gh/lemoeo/AX6S@main/auto_ssh.sh | ||
chmod +x auto_ssh.sh | ||
uci set firewall.auto_ssh=include | ||
uci set firewall.auto_ssh.type='script' | ||
uci set firewall.auto_ssh.path='/data/auto_ssh/auto_ssh.sh' | ||
uci set firewall.auto_ssh.enabled='1' | ||
uci commit firewall | ||
uci set system.@system[0].timezone='CST-8' | ||
uci set system.@system[0].webtimezone='CST-8' | ||
uci set system.@system[0].timezoneindex='2.84' | ||
uci commit | ||
mtd erase crash | ||
reboot | ||
``` | ||
|
||
SSH 密码设置为 admin,用户名设置为 root,并永久开启 SSH 端口。待设备重启完成后,你就可以使用该用户名密码连接设备的 SSH 了。 | ||
|
||
_参考文章:https://www.gaicas.com/redmi-ax6000.html_ |