You removed the peer. wg show confirms it is gone. A week later the laptop you revoked connects
again, and nothing in your logs explains it.
Black Friday 2026VPN prices read on 16 Nov: Proton VPN Plus $59.76 for 24 months, Surfshark €67.23 for 27 months, next to a self-hosted VPS. See the dated comparison · Get the Proton VPN deal (affiliate link) · Proton Unlimited at $6.49 a month: the bundle, priced
Nothing went wrong. WireGuard simply has two states, and the command you used only changed one of them.
The two states
| what it is | what changes it | |
|---|---|---|
| running state | what the kernel currently accepts | wg set, wg syncconf |
| configuration file | what gets loaded on the next start | your editor, wg-quick save |
wg set wg0 peer PUBLIC_KEY remove acts on the first. It is immediate, it leaves every other peer
connected, and it never touches /etc/wireguard/wg0.conf. The public key you pass is the 32-byte
Curve25519 key printed as 44 base64 characters, which is why a peer is identified by that string
and not by a name: WireGuard stores no name for it.
So the next wg-quick down wg0 && wg-quick up wg0, a reboot, a package upgrade, a systemd
restart you did not think about, reads a file that still contains the peer, and puts it back.
Nobody is notified. The access simply resumes.
Removing it for good
Two orders of operation, and the second is the one to prefer.
The quick one, when the file has nothing you care about:
sudo wg set wg0 peer PUBLIC_KEY remove
sudo wg-quick save wg0
wg-quick save writes the running state back to the file. It works, and it rewrites the file from
the kernel's point of view. Your comments disappear. On a server with a dozen peers, those
comments are usually the only record of which peer is which laptop. Losing them turns a readable
config into a list of anonymous public keys.
The one to prefer, which keeps the file authoritative:
sudo nano /etc/wireguard/wg0.conf # delete the whole [Peer] block
sudo wg syncconf wg0 <(wg-quick strip wg0)
wg syncconf applies the file to the running interface without bringing it down: only what
changed is affected, and the other tunnels keep their sessions. wg-quick strip removes the
directives the kernel does not understand, Address, DNS, PostUp, and prints what remains.
The distinction matters on a server with several clients: wg-quick down && up drops everyone for
a couple of seconds to revoke one peer. The kernel implementation accepts up to 1 048 576 peers per
device, so the limit you hit first is your own ability to tell them apart, not the protocol's.

Two flat keys on a single ring, hanging from a pale metal plate screwed to a light wooden door. The upper key carries the engraved initials « R.M.I. ». Warm tones, visible wood grain.
Verify in both places, not one
sudo wg show wg0 peers # what the kernel accepts now
grep PublicKey /etc/wireguard/wg0.conf # what loads next time
A key absent from the first and present in the second is a revocation with an expiry date. It is the exact situation this article exists for, and it is invisible until the day the interface restarts.
The live commands used here (wg set wg0 peer <pubkey> remove, wg show wg0 latest-handshakes, wg show wg0 endpoints) sit on one printable A4 page in our free WireGuard Cheat Sheet, next to the [Peer] keys and the command that adds a peer back live. Direct download, no sign-up. Download the cheat sheet.
What revoking does not do
Removing the peer means the server refuses the handshake. The key material on the lost device becomes useless against this server. That is real, and it is where the effect stops.
The revocation is not quite instantaneous, and the delay is bounded by the protocol's own timers.
A session key is rejected after 180 seconds (REJECT_AFTER_TIME), and a new handshake is normally
initiated after 120 seconds (REKEY_AFTER_TIME). So a session already established when you removed
the peer can keep carrying traffic for up to three minutes before the kernel drops it. If that
window matters, bring the interface down rather than waiting it out.
The configuration file is still on that device. So is its private key, and whatever else the device held, a session that was still open, a password manager left unlocked, the mailbox that can reset your other accounts. Revoking the tunnel is the right first move. It is not the whole response, and treating it as such is how people end up perfectly confident and still exposed.
Situate your own attack surface, 10 questions, about three minutes, no account, no email, nothing stored. The result names the one change that reduces your exposure the most, and for someone who self-hosts it is rarely another firewall rule.
In short
| What you did | What it actually changed |
|---|---|
wg set … peer … remove | the running state only, reverts on restart |
wg-quick save | the file too, at the cost of your comments |
edit the file, then wg syncconf | both, without dropping the other peers |
| revoked after losing a device | the tunnel, not what the device still holds |
One line worth keeping: a peer removed from memory and left in the file is not removed, it is postponed.
When the revoked device needs a replacement, generate a fresh key pair rather than reusing the old one: our WireGuard config generator writes the new client file and its QR code, and a server file whose [Peer] block you copy into yours before wg syncconf. The generator is free with no account, up to 250 devices, and its ZIP export holds every client .conf and its QR code as a PNG, handy to set up a whole office or family in one go.
Generate your WireGuard configs here
Type your server address, choose the number of devices, then scan each QR code from the app.
All keys are generated in your browser (Curve25519 / X25519). Nothing is sent to our servers - your config stays 100% private.
Public IPv4 or domain of the machine that will run WireGuard. No server yet? Leave it empty and add it later.
Free, no account: up to 250 clients, each .conf with its QR code, and one ZIP with every file.
Everything the device sends to the internet goes through your server.
Advanced settingsTunnel subnet, DNS, site-to-site LANs. The defaults work for most setups.
Optional. Enter the LAN subnet behind the server and/or behind a client that acts as a site gateway (a router, a Raspberry Pi, a NAS). The generator adds each LAN to the server's AllowedIPs, gives every peer the routes to the other LANs, and writes the forwarding rules on the gateways. Leave a field empty for a normal client.
What you download
wg0.conf
for the server
client1.conf
one per device
QR (sample)
for the phone app
Illustration only: the lines and the QR code are fictional, no real key. Your real files are generated in your browser when you click.
Affiliate link
★ Nuremberg GDPR datacenter · ✓ Dedicated IPv4 included · 200 Mbit/s port
Self-host your VPN on your own VPS → ContaboCloud VPS 4 · 4,40 €/mo · Card or PayPal · orders from outside the EU accepted→Checked 17 Nov 2026: €4.40 for the first 24 months, list price €5.50


