前段时间看到一个很好用的路由器插件,因为这个,我突然发现家里的路由器竟然一直没打开 ssh 登陆的功能。
Background
小米路由器AC2100(R2100)
固件版本:2.0.743
打开方式
登陆 “miwifi.com” 或 “192.168.31.1”, 在登陆看到主界面后复制下当前网址
# 网址名应该类似于:
http://192.168.31.1/cgi-bin/luci/;stok=KEY/web/home#router
记录下“KEY”的值,并替换到以下网址中
# 打开 ssh 登录
http://192.168.31.1/cgi-bin/luci/;stok=KEY/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
# 改root密码, 这一步还需要将“YOUR_PASSWORD”替换为路由器管理员密码
http://192.168.31.1/cgi-bin/luci/;stok=KEY/api/misystem/set_config_iotdev?bssid=Xiaomi&user_id=longdike&ssid=-h%3B%20echo%20-e%20'YOUR_PASSWORD%YOUR_PASSWORD'%20%7C%20passwd%20root%3B
# 关闭ssh 登录
http://192.168.31.1/cgi-bin/luci/;stok=KEY/api/misystem/set_config_iotdev?bssid=Xiaomi&user_id=longdike&ssid=-h%3B%20nvram%20set%20ssh_en%3D0%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
进入网址后显示{“code”:0}即表示操作成功。
随后便可以直接在 Terminal 上登陆
ssh [email protected]
评论区