Closing Your Server: Approving Clients
By default an rvpn-server accepts any client that has its connection details. Client admission closes it: only devices you have approved can connect, and everyone else is refused until you approve them. It is available from v1.4.0 and is off until you turn it on.
Each device is recognised by its identity key, which the app creates and which never leaves the device. The server checks that a client really holds the key it presents before it applies admission, so nobody can get in by copying someone else’s public key.
How it works
Section titled “How it works”- Learn mode: every client still gets in, and the server records each device that connects as approved, as long as its app supports admission (see below). Use it to collect the devices you already trust. Learn mode stops recording after 4,096 devices, though it still lets them in.
- Enforce mode: only approved devices get in. An unknown device is refused and added to a pending list for you to review.
- A refused device is told only that it is waiting for approval. It is never told whether its key was known before, so the refusal reveals nothing about who else is approved.
- You manage everything with
rvpn-server clients …on the server itself, as root. There is no network admin interface: approving a device needs a shell on the server. - The running server picks up every change within a couple of seconds. You never restart it.
Turn it on
Section titled “Turn it on”Add an [server.admission] section to your server config and restart the server once:
[server.admission]enabled = truemode = "learn"| Field | Default | What it does |
|---|---|---|
enabled | false | Turns admission on. While false, every client is admitted, as before v1.4.0. |
mode | "learn" | Starting mode: "learn" or "enforce". Any other value stops the server from starting. After the first clients mode command, the mode stored in the allow-list wins over this field. |
allow_file | /usr/local/etc/rvpn/clients.json | The approved devices. Written by the clients commands, root-only (0600). |
pending_file | /usr/local/etc/rvpn/clients-pending.json | Refused devices: fingerprint, first and last attempt, and number of attempts. No IP addresses are stored. |
audit_file | /usr/local/etc/rvpn/clients-audit.log | Append-only record of every approve, revoke and mode change. |
If the allow-list file can’t be read or parsed, the server keeps the last good list. In enforce mode it then refuses every device rather than letting anyone in.
Roll it out
Section titled “Roll it out”-
Start in learn mode (the config above) and let your existing users connect as normal. Each device whose app supports admission is approved automatically and marked
learned. Devices on older apps keep working, but aren’t recorded. Make sure everyone has updated before the next step. -
Check who has been learned:
Terminal window sudo rvpn-server -c /usr/local/etc/rvpn/server.toml clients listEach line shows the short fingerprint, the label if you set one, the full fingerprint, when it was approved, and whether it was
learnedorapprovedby hand. Revoke anything you don’t recognise (see below). -
Close the server:
Terminal window sudo rvpn-server -c /usr/local/etc/rvpn/server.toml clients mode enforceFrom now on, unknown devices are refused. You can switch back with
clients mode learnat any time; neither switch needs a restart.
Run the clients commands with the same -c config file the server uses, so they edit the right files. If admission is still enabled = false in that config, the command warns you that the change has no effect yet.
Approve a new device
Section titled “Approve a new device”-
Ask the person to try to connect now. Their app shows that it is waiting for approval; the desktop client stops with
server refused this client key: pending_approval. -
Wait about 30 seconds, then list pending devices. The pending list is saved to disk every 30 seconds, so a very recent attempt can take that long to appear:
Terminal window sudo rvpn-server -c /usr/local/etc/rvpn/server.toml clients pending3f9a1c0be47d2e85 first=1764912000 last=1764912090 attempts=2Each line is the first 16 characters of the device’s fingerprint, then the first and last attempt (Unix time) and the number of attempts. The
lasttime and the count update at most once a minute per device, so several tries within a minute count as one.Matching by time is the weaker check. It doesn’t prove who connected: anyone who tries at the same moment also appears as a pending entry, and when many unknown devices try at once the server records only some of them. Approve only when exactly one new pending entry appeared, with a
firsttime inside their attempt. To double-check, ask them to try again more than a minute later and see that entry’sattemptsgo up by one. If there is any doubt, don’t approve: ask them to try again. If you approve the wrong device, revoke it straight away.The apps will show each device’s short fingerprint on the waiting-for-approval screen, so you can match it exactly. That isn’t available yet.
-
Approve it, with a label so you can recognise it later:
Terminal window sudo rvpn-server -c /usr/local/etc/rvpn/server.toml clients approve 3f9a1c0be47d2e85 --label "Jeremy laptop"You can give the 16-character short fingerprint, the full 64-character one, or any longer prefix of at least 16 characters. If a prefix matches more than one key, the command refuses it and you give more characters. The device can connect straight away.
If several unknown devices are waiting at once, approve none of them by guesswork: ask each person to connect again, one at a time.
Revoke a device
Section titled “Revoke a device”sudo rvpn-server -c /usr/local/etc/rvpn/server.toml clients revoke 3f9a1c0be47d2e85The device is removed from the approved list, and any session it has open is dropped within a few seconds. A revoked device is refused in both modes: unlike a new device, it isn’t let in or re-learned in learn mode. To let it back in, run clients approve with the same fingerprint.
Command reference
Section titled “Command reference”| Command | What it does |
|---|---|
clients pending | List refused devices: short fingerprint, first and last attempt, attempts. |
clients list | List approved devices with labels, when they were approved, and learned or approved. |
clients approve <fingerprint> [--label "name"] | Approve a device. Takes effect within seconds. |
clients revoke <fingerprint> | Remove a device and drop its live sessions within seconds. It stays refused in both modes until you approve it again. |
clients mode learn / clients mode enforce | Switch mode without a restart. |
Every approve, revoke and mode change is written to the audit file.
Things to know
Section titled “Things to know”- Admission is per server. If you run several servers, approve the device on each one it should use.
- A person who reinstalls the app, or uses a new device, has a new identity key and needs approving again.
- Admission controls who can connect. It does not replace keeping the server’s own login (SSH) locked down.