当心,这些都是非常核心的,可能会损害您的硬件.它需要单个UDP数据包传输的时间重新启动.繁荣.我们只在活的无盘计算机上使用它.
1. xt_SYSRQ(iptables模块,内核)
有xt_SYSRQ,由xtables-addons-common提供的iptables模块之一:http://manpages.ubuntu.com/manpages/oneiric/man8/xtables-addons.8.html
在debian上安装
#!/bin/bashapt-get install -qq xtables-addons-common iptablesecho -n "yolo" >/sys/module/xt_SYSRQ/parameters/passwordiptables -A input -p udp --dport 9 -j SYSRQ
猎q重启
#!/bin/bashsysrq_key="sub" # the SysRq key(s),Sync,Unmount,reBootpassword="yolo"seqno="$(date +%s)"salt="$(dd bs=12 count=1 if=/dev/urandom 2>/dev/null | openssl enc -base64)"ipaddr=""req="$sysrq_key,$seqno,$salt"req="$req,$(echo -n "$req,$ipaddr,$password" | sha1sum | cut -c1-40)"echo "$req" | socat stdin udp-sendto:$ipaddr:9
sysrqd(tcp 4094监听守护进程,用户界面)
该解决方案仅在您的bricked计算机能够处理TCP连接时才起作用.
在debian上安装
#!/bin/bashapt-get install -qq sysrqdecho "yolo" > /etc/sysrqd.secretservice sysrqd restart
关闭重启
我做了一个脚本,https://gist.github.com/qolund/1470beaa1a63e034025d,但它只是端口4094上的一个TCP连接.
您需要发送密码和命令,
# telnet 172.16.42.180 4094Trying 172.16.42.180...Connected to 172.16.42.180.Escape character is '^]'.sysrqd password: nopeGo away!Connection closed by foreign host.# telnet 172.16.42.180 4094Trying 172.16.42.180...Connected to 172.16.42.180.Escape character is '^]'.sysrqd password: yolosysrq> sub[..]
连接没有正确关闭,因为’b’reboot命令太快,计算机已经重新启动.
总结以上是内存溢出为你收集整理的远程关机/重新启动没有SSH的Linux机箱?全部内容,希望文章能够帮你解决远程关机/重新启动没有SSH的Linux机箱?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)