Hardening NixOS After I Got Hacked A NixOS operator reported that an attacker using the same SSH key the operator had used for nearly 10 years logged into 12 of the operator's servers, including 434 successful SSH login attempts from an unrecognized IP address in Heilongjiang province, China, on 2026-10-14. The operator, who documented the incident in a post titled "Hardening NixOS After I Got Hacked," said the attacker moved laterally through a mesh VPN, ran a `python3 -` process that consumed all CPU, and appeared to be an AI agent given the repeated short SSH sessions, but found no rootkits, abnormal file changes, or evidence of how the key was obtained. The operator rotated SSH keys, shut down externally facing services, backed up and reinstalled the OS on every server, and reset potentially stolen credentials, while noting the logs never revealed the key's entry point. Preface On the night of 2026-10-14, I suddenly got an alarm from Alertmanager about persistent high CPU usage on one of my servers: That's weird, as that server doesn't run any services that is expected to have continuous CPU usage. Then, when I logged on to the server to check what's going on, I indeed found a process, python3 - , consuming all the CPU. The dash sign - in python3 - means the Python process will read the code it's supposed to execute from standard input. However, I always save the code as a .py file before running it, and had never run any code like that. Nevertheless, if you have used AI/LLM agents before, you might have noticed that python3 - is a characteristic of AI agents, as they love to run code in the following way: bash Input command $ python3 - <