红米AX6000路由器ssh
- 技巧
- 2023-12-27
- 115热度
- 0评论
2.固化SSH
- 修改 Hosts 屏蔽升级域名(最有效)
这会将小米的升级服务器指向本地回环地址,从根源上切断检测更新的请求。
复制以下整段代码,粘贴到终端并回车执行:
Bash
备份 hosts 文件
cp /etc/hosts /etc/hosts.bak
写入屏蔽规则
echo "127.0.0.1 api.miwifi.com" >> /etc/hosts
echo "127.0.0.1 d.miwifi.com" >> /etc/hosts
echo "127.0.0.1 data.mistat.xiaomi.com" >> /etc/hosts
echo "127.0.0.1 r.miwifi.com" >> /etc/hosts
echo "127.0.0.1 a.stat.xiaomi.com" >> /etc/hosts
重启网络服务生效
/etc/init.d/dnsmasq restart
- 修改 NVRAM 配置禁止自动升级
虽然 hosts 最稳,但修改系统变量作为双重保险。
复制执行:
nvram set ssh_en=1; nvram set telnet_en=1; nvram set boot_wait=on; nvram commit
3.永久开启SSH(重启不会关闭):
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
4.修改时区设置
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
5.关闭开发/调试模式
mtd erase crash
6.重启
reboot
