> **Initial admin**: no default user is created. On first run with an empty users table the admin is seeded only from OVPMON_INITIAL_ADMIN_USER / OVPMON_INITIAL_ADMIN_PASSWORD; the username can be changed in Account (see DOCS/Changes/2026-09-30_Admin_Username_Change.md).
-**Signing key (fail closed)**: tokens are signed with `OVPMON_API_SECRET_KEY` (or `[api] secret_key`); there is no built-in default. A missing, blank, placeholder (`change-me`/`changeme`) or shorter than 32 characters key stops the API at start (critical log without the key, exit code 1, before the database is opened). The same rule is checked by the install and update scripts. See [Configuration](Configuration.md).
The Backup and Restore function ([guide](../Profiler_Management/Backup_Restore.md)) makes a package of the application data. What matters for security:
-**What a package holds:** the CA private key and all issued keys (`pki/`), the monitoring database (administrator password hashes, 2FA secrets), the profiler database and the issued client profiles. Whoever can read a package can impersonate the VPN server and its clients. The JWT signing key and the environment file are **not** in it.
-**Encryption:** with a passphrase (at least 8 characters) the package is encrypted with AES-256-GCM in 1 MiB blocks; the key comes from scrypt (N=2^15) with a random salt; the header is authenticated, so truncation and tampering are detected. **Remote destinations (S3, SFTP, FTP) refuse to work without a passphrase.** A local folder works without it and the page warns. The passphrase is never stored in a package; without it an encrypted package cannot be opened.
-**Secrets of the function:** destination secrets (keys, passwords, SFTP private key) and the package passphrase are stored in `ovpmon_backup.db`, encrypted (Fernet) with a key derived (HKDF-SHA256) from the JWT signing key. The API returns `********` instead of a value and never logs one; error messages carry no secrets. If the signing key changes they cannot be read any more and must be entered again. `ovpmon_backup.db` (mode 600) is not part of a package and is never replaced by a restore.
-**SFTP:** the SSH host key is pinned by its SHA-256 fingerprint. The first Test shows the fingerprint and the administrator confirms it; until then nothing is sent to the server (not even the password) and every operation is refused. Unknown keys are never accepted automatically, and a changed key breaks the connection before credentials are sent. **FTP:** explicit TLS and certificate verification are on by default; plain FTP and an unchecked certificate are explicit, warned choices. S3: TLS by default.
-**Local storage:** the backup root (`/var/lib/ovpmon/backups`, containers `/app/backups`) and its folders are mode 700, packages 600, owner `ovpmon`; folder names are validated, links and paths outside the root are refused. In containers the volume `ovp_backups` is not covered by `deploy/docker/backup.sh`.
-**Restore as a trust boundary:** all routes need the JWT (any administrator can start a restore, and a restore replaces the administrator accounts). The package is unpacked into a temporary directory with an allowlist of names (no absolute paths, `..`, links, devices; size and entry limits), checked against the SHA-256 sums of its manifest and migrated there; the running system is touched only after all that and after a safety copy of the current state. The sums are inside the package: they detect damage, not forgery. **Authenticity comes from encryption** (a forged encrypted package fails the GCM check), so an unencrypted package from a place others can write to must not be restored. During a restore requests that change the PKI, profiles, settings or the OpenVPN process return `409`.
-**Limits:** the passphrase and destination secrets are only as safe as the JWT signing key and the file permissions of the server; a stolen package with its passphrase, or a stolen `.env` with `ovpmon_backup.db`, opens the CA key.