当云主机被挖矿以后,通常都不能很快清除挖矿程序,而这时你的云主机cpu占用率会一直居高不下,为避免主机被锁定可先用这个脚本杀死挖矿程序,而后再来慢慢排查问题。bash
#!/bin/bashthis
# This script is used to kill progress which having abnormal occupancy rate of CPU,spa
# I want through this way to protect my server from the hacker who attempting to use my server to mining.orm
# The method is capture PID which progress' occupancy rate of CPU greater than 90% by awk,then kill these PID.server
while true;doip
for i in `ps aux | awk '{if($3 > 90){print $2}}'`;doawk
kill -9 $ised
donehack
done程序