小米路由器AX1800降级后的SSH登录和关墙等命令

​​​​​​​​​​​​​​​​​​​​​http://192.168.31.1/cgi-bin/luci/;stok=429aaa9c7f05ee7d0816a00257b8414a/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 

1、开启路由器SSH远程访问

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

2、更改root登录密码

vi /etc/rc.local

3、打开路由器防火墙


ip6tables -I forwarding_rule -p tcp --dport 5000 -j ACCEPT
ip6tables -I forwarding_rule -p udp --dport 5000 -j ACCEPT

4、开放5000端口TCP和UDP连接的命令

5、定时检测命令#crontab -e


*/5 * * * * ip6tables -L | grep "tcp dpt:5000";[ $? != 0 ] && echo "add port" && ip6tables -l forwarding_rule-p tcp --dport 5000 -jACCEPT

6、在定时检测文件中,定稿定时开启启用端口的命令

7、重启reboot


 

你可能感兴趣的:(ssh,运维)