Linking Servers
Pair two Vaulthalla servers, give the linked server a vault role, check the link's health, rotate keys and unlink.
A link is a pinned, mutually authenticated connection between two Vaulthalla servers. It is the trusted connection mirrored vaults travel over, and it carries nothing else. Each server pins the other's key: there is no certificate authority and no trust store. Once linked, either side dials, and the link comes back by itself after a restart or a network loss.
Linking takes a super admin on each server. Run vh as your own account, not with sudo.
Link Two Servers
In these steps, server A accepts the link and server B dials it. Either can play either part; usually A is the server that has the vault you want to mirror.
Let the other server reach this one
Linking uses the device listener (port
36972by default). On a server that should be reachable from other hosts, open it beyond this host, and allow the port through any firewall between the two:1vh device remote enable2vh device remote statusOpen a window on server A
1vh peer pairYou will see when the window closes (10 minutes from now), this server's name, node id and key, and the addresses the other server can use:
1Window for linking a server open until 2026-12-01 14:32:00 UTC.2This server: "core", node 7f3c…3 key 3a9e…4 reachable at 192.0.2.10:36972 (lan)5On the other server run `vh peer link <address>`, then pick the code it shows here.6Waiting for the other server... (Ctrl-C to stop)Only one pairing window can be open at a time, and it is shared with device pairing.
Dial it from server B
1vh peer link core.example.net # host, host:port or [v6]:port; port 36972 by defaultServer B prints the server it reached, its key, and a six-digit code to pick on server A, then waits.
Pick the code on server A
vh peer pairon server A shows the request and three codes:1Which code does the other server show? [1] 482 913 [2] 107 554 [3] 930 216Pick the one server B printed. A wrong pick declines the request; start again with
vh peer linkon server B. Both servers printLinked:with the other's name, node id and number, and each lists the other withvh peer list.
To approve later instead of waiting at the prompt, leave vh peer pair --json open the window without waiting, then:
1vh peer pending # requests, each with three codes2vh peer approve <request> --code <code>3vh peer deny <request>
Pin the other server's key
To trust nothing but the server you expect, give its key (SPKI SHA-256, 64 hex digits, as vh peer pair prints it)
with --fingerprint on either side. Any other key is refused:
1vh peer link core.example.net --fingerprint <hex>2vh peer approve <request> --code <code> --fingerprint <hex>
Without a fingerprint, the code you compare is the check.
In the web console
System › Linked servers (super admins only): Accept a link on server A opens the window and shows this server's key and addresses; Link a server on server B dials it by address and port, optionally pinned to its key, and shows the code to click on server A's request. Making a link asks you to confirm it's you.
Give The Linked Server A Vault Role
A linked server is never a user. On the core, what its people may do in a vault it mirrors is a vault role: the default for the link, or one for a single vault. It is sent to the mirror with the vault and every time it changes, and it is the limit on what the mirror's people may change there.
| Command (on the core) | Effect |
|---|---|
| Its people may only read the vaults it mirrors from here. | |
| They may also change files. Any vault role's name or id works. | |
| No default role: nobody there can open a mirrored vault unless the vault assigns one. | |
| The current default, who set it and when. | |
A role for one vault, overriding the default. implicit_deny means no access to that vault whatever the default says. | |
| Go back to the link's default for that vault. |
Whoever may assign vault roles on a vault may set its role for a linked server; the link's default needs that on every
vault. vh vault role list <vault> shows a linked server's role by name. See vault roles.
Check A Link
1vh peer list # every linked server and its link's health; --all adds unlinked ones2vh peer info <server> # its key, announced next key, version, endpoints, who compared the code
A healthy link reads connected since <time> (this server dialled, 12 ms), or it dialled when the other server made the connection. The web console's
Servers tab shows the same: connected since when, which side dialled, the round trip and the other server's version.
Rename Or Unlink
1vh peer rename <server> <name> # this server's own label; the other keeps its own name for this one2vh peer unlink <server>
Unlinking closes the link and refuses the other server's key from then on. The other server is told (if it is connected) and unlinks too. Every mirror between the two ends, and each server keeps the copies it holds as orphaned copies. No files, vaults or accounts change on either server. Linking them again takes a new pairing with a new code; to mirror a vault both still hold, see Reconnecting A Mirror.
Rotating This Server's Identity
vh secret device-identity rotate tells every connected linked server about the new key first, signed by the old one,
and they keep their links. Servers that were not connected at that moment are unlinked and must be linked again.
--revoke-peers is the emergency rotation: it tells no one and drops every link. See vh secrets.
If Linking Fails
Linking problems
- Cause
- Server A's device listener only listens on that host, or a firewall blocks port
36972 - Fix
- On server A,
vh device remote enableandvh device remote status; open the port between the two hosts.
- Cause
- A device or a server is being paired on that server; one window at a time
- Fix
- Wait for it to finish, or close yours with
vh peer pair --close, then try again.
- Cause
- The 10 minutes ran out; its requests expired
- Fix
- Run
vh peer pairagain, thenvh peer linkagain on the other server.
- Cause
- A wrong code was picked
- Fix
- Start again with
vh peer linkon the other server.
- Cause
- The request expired or was already answered
- Fix
- Start the link again on the other server.
- Cause
- You are not a super admin, or ran
vhwithsudo(root is not a super admin here) - Fix
- Run
vhwithoutsudo, as a super admin account.
- Cause
- The other server is down or unreachable at its endpoints
- Fix
vh peer info <server>shows its endpoints; the link comes back by itself once it is reachable.
Related reference: vh peer, vh device, Direct Device Connections.
