Last updated: 24 October 2026. Sources are listed at the end.
In early October 2026, attackers took over hundreds of Tor relays and used them to intercept SSH logins. Viral posts say “333 relays were hijacked to steal logins”. The real story is narrower, and it carries a lesson for every Linux admin: never click through an SSH host key warning. This guide explains what happened with the hijacked Tor relays and how to make sure the same trick can’t work on your servers.
Affected by this? Emergency exposure check, ₹2,999, 48 hours. Send us up to 5 hosts, sites or product versions. Within 48 hours you get a written verdict for each one, what to patch first and how to verify the fix. Book the check or ask a question first.
The short answer
- Who was at risk: people who used Tor to SSH into a server between 1 and 5 October, accepted a “host key changed” warning and then typed a password.
- Who was safe: anyone who logged in with SSH keys, or who stopped at the warning.
- What to do: if that describes you, change the password and check the server for the Ebury backdoor. Then switch to key-only logins everywhere.
What happened with the hijacked Tor relays
The attackers didn’t run their own relays. Instead, they broke into Linux servers that volunteers used to run Tor relays. Ebury, a well-known SSH backdoor, had infected those servers. In the best-documented case, the attacker got in on 28 August through a reused password.
From 1 October, the attackers edited each relay’s configuration:
- They opened port 22 (SSH) and turned 24 non-exit relays into exit relays.
- They sent SSH traffic to one of 12 interception servers.
- They blocked encrypted mail ports and allowed plain IMAP and POP3, so they could read mail passwords too.
Researchers counted port 22 opened on 342 relays. The Tor Project’s directory authorities began flagging them on 4 October, and by the afternoon of 5 October none were left in the network.
How the SSH interception worked
When you SSH through a hijacked exit, you actually reach the attacker’s server. That server has a different host key, so your SSH client shows a big warning:
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @If you accepted it and typed a password, the attacker passed your session to the real server. Meanwhile, it logged every command, saved your password and later installed Ebury on your server.
The attacker could not relay key-based logins. It could only show a fake shell, because your private key never leaves your machine. This is the main reason to use keys.
Check whether you saw the attacker’s key
Researchers published the interception server’s host key fingerprint:
SHA256:6baCZCPsl+AfQuujUS81fMEE/C7UeJ+AwjrImqmDB3ESearch your known_hosts for it:
ssh-keygen -lf ~/.ssh/known_hosts | grep '6baCZCPsl+AfQuujUS81fMEE'If it appears, you accepted the attacker’s key at some point. Remove that entry with ssh-keygen -R <host>, change the server’s password and check the server.
Step 1: Verify host keys properly
The first time you connect, SSH asks you to trust a fingerprint. Compare it with the real one, taken from the server’s console or your cloud provider’s serial log:
# On the server (console or provider web terminal)
ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
# On your laptop, show what you have stored for a host
ssh-keygen -lF server.example.comThen make SSH strict. Add this to ~/.ssh/config:
Host *
StrictHostKeyChecking ask
VerifyHostKeyDNS yesWith VerifyHostKeyDNS, SSH can check the key against an SSHFP DNS record. Generate the records on the server and publish them in DNS, ideally with DNSSEC:
ssh-keygen -r server.example.com -f /etc/ssh/ssh_host_ed25519_key.pubStep 2: Switch to key-only SSH logins
Create a drop-in file, for example /etc/ssh/sshd_config.d/10-keys-only.conf:
PasswordAuthentication no
KbdInteractiveAuthentication no
PubkeyAuthentication yesTest and reload, but keep your current session open until you confirm a new key login works:
sudo sshd -t && sudo systemctl reload ssh
sudo sshd -T | grep -Ei '^(passwordauthentication|kbdinteractiveauthentication)'On RHEL-family systems the service is called sshd. We tested this config on Ubuntu, and sshd -T reported both settings as no. For even stronger protection, use hardware security keys (ed25519-sk).
Step 3: Check for Ebury if you’re worried
Ebury hides inside the SSH software itself, so normal checks can miss it. ESET publishes a free detection script. In addition, verify your OpenSSH packages:
# Debian/Ubuntu: changed files in OpenSSH packages
sudo dpkg --verify openssh-server openssh-client
# RHEL family
sudo rpm -V openssh-server openssh-clientsOn minimal or container images, “missing” lines for man pages and docs are normal. A changed binary, shown with a 5 in the checksum column, is a red flag. In that case, rebuild the server rather than trying to clean it.
If you run a Tor relay
The Tor Project asks relay operators to check for an Exit flag they didn’t set, review torrc, look for firewall rules that redirect port 22 and verify the tor binary. If anything looks wrong, reinstall, create a new relay identity, rotate all credentials and report it to the Tor Project. ESET warns there are most likely other compromised relays.
Quick checklist
- ☐ Never accept a changed host key without checking it another way
- ☐
known_hostssearched for the attacker’s fingerprint - ☐ Password logins disabled on every server
- ☐ SSHFP records published for important servers
- ☐ OpenSSH packages verified
Our free Linux server hardening checklist covers SSH and much more. If you want an expert review, see our Linux server hardening and audit. For the other incidents of the month, read our Black October fact-check.
Related guides
- ISO 27001 Cryptography: Control 8.24 Use of Cryptography Explained
- What Is an IP Address? IPv4 and IPv6 Explained
- Internet and Web Technology Basics: Internet vs Web, URLs and DNS
- Linux User and Group Management: Commands and Best Practices
Sources
- Tor Project: security incident affecting some relay operators
- The Hacker News: attackers hijacked over 300 Tor exit relays
- kaba.cx: analysis of the SSH interception
- ESET: Ebury detection script
- Tor Metrics: relay flags
Running Linux servers in production? Our Linux server hardening & security audit checks configuration, patching, SSH and logging. You can also use our free Linux server hardening checklist, or contact us.
