A process using all CPU with a random or disguised name, running from /tmp, /dev/shm or a deleted binary, and connecting to a mining pool is a strong sign of compromise. Isolate the server, preserve evidence, remove persistence (cron, systemd units, SSH keys) and find the entry point. If you cannot be sure you found everything, rebuild the server from a clean image.
Symptoms
- CPU at 100% from an unfamiliar process
- Process names like kdevtmpfsi, kinsing, xmrig or random strings
- New cron entries or authorized_keys you did not add
How to diagnose it
Find the process and its binary
A binary in /tmp, /dev/shm or marked (deleted) is a red flag.
ps -eo pid,user,%cpu,cmd --sort=-%cpu | head sudo ls -l /proc/PID/exe sudo ls -l /proc/PID/cwdCheck its network connections
Connections to ports like 3333, 4444, 5555 or 14444 are typical of mining pools.
sudo ss -tnp | grep PIDLook for persistence
Check every user’s crontab, system cron, systemd units and SSH keys.
for u in $(cut -d: -f1 /etc/passwd); do sudo crontab -l -u "$u" 2>/dev/null | sed "s/^/$u: /"; done ls -la /etc/cron.* /var/spool/cron 2>/dev/null systemctl list-unit-files --state=enabled sudo find / -name authorized_keys -mtime -30 2>/dev/nullCheck for exposed services
Miners commonly arrive through exposed Redis, Docker API (2375), weak SSH passwords or vulnerable web apps.
sudo ss -tulpn
Common causes and fixes
Exposed Redis, Docker API or database without auth
Bind the service to localhost or a private network, require authentication, and firewall the port.
Weak SSH passwords
Disable password logins and use keys.
# /etc/ssh/sshd_config
PasswordAuthentication no
PermitRootLogin prohibit-password
# then
sudo systemctl reload sshVulnerable web application or plugin
Patch the application, check for web shells, and review web server logs around the time the miner appeared.
Persistence after a quick kill
Killing the process alone rarely works; a cron job or service restarts it. Remove persistence, then kill. Rebuilding is the only way to be certain.
Prevent it happening again
- Statance security monitoring flags likely miners, binaries running from /tmp and deleted executables.
- Alert when CPU_overall is above 90% for 10 minutes — an unexplained, constant 100% is often the first sign.
- Firewall every port that does not need to be public.
Set it up: Linux monitoring.
FAQ
What is kdevtmpfsi?
A widely reported crypto-mining malware binary, usually dropped alongside kinsing through exposed services such as Redis or Docker. Treat the server as compromised.
Is killing the miner process enough?
No. Attackers add cron jobs, services and SSH keys to restart it, and the original hole is still open.
Related guides
Get alerted before this becomes an outage.
Install the agent in one line. Statance watches CPU, memory, disk and services, and its AI assistant helps find the cause.