Clokeep Clokeep Docs
Documentation API Reference
StorageSFTP storage and Hetzner Storage Box
Storage View as Markdown

SFTP storage and Hetzner Storage Box

Store backups on any server you can sign in to over SFTP with a password or an SSH key, including a Hetzner Storage Box.

An SFTP storage keeps your backups as files on a server you sign in to over SSH. A Hetzner Storage Box is an SFTP storage on port 23.

Prerequisites

  • A Clokeep account with the Admin or Operator role.
  • An SFTP account on the server with a password or an SSH key, and a folder it may write to.
  • Access to the server's SSH port from each server you back up and from the Clokeep panel. See Who connects to whom. A server that accepts only known addresses must allow the panel's addresses.

Add the storage

Open the form

Open Storages and click New storage. Enter a Name and pick SFTP under Driver.

Fill in the connection settings

  • Host: the server's host name, such as backup.example.com.
  • Port: the SSH port. Left empty, it is 22.
  • Root path: the folder that holds your backups, such as /home/backups. The field starts at /. Pick a folder the account may write to.
  • Host key: leave it blank. Test connection and Create fetch the server's key and fill it in. You can also click the refresh icon on the field to fetch it now, or paste the key. See The host key.

Under Credentials, enter the Username, and the Password or a Private key. See Sign in with a private key.

The Create Storage form with the SFTP driver, host, port 23, root path, an empty host key and credentials

An SFTP storage for a Storage Box on port 23, filled in before Create.

Test the connection

Click Test connection at the top of the page. Connection successful means the panel signed in and listed your Root path. The test saves nothing.

With Host key blank, the test first fetches the server's key, tests with it and fills the field with it. Check that it is your server's key. Create then keeps it.

When the key cannot be fetched, the test fails with "Could not read the SSH host key of …". Nothing connects without a key.

Create the storage

Click Create. The panel pins the server's host key and shows Host key pinned. If Host key is still empty, the panel fetches it now.

Add the storage to a plan under Storages to start using it.

Hetzner Storage Box

Pick SFTP and set Port to 23. Left empty, the port is 22. On a Storage Box that times out with an error that looks like a firewall problem.

Sign in with a private key

Instead of a password, you can paste a private key into Private key. Its public key must be in the account's authorized_keys on the server.

The key must be:

  • the key text itself, starting with -----BEGIN. A path to a key file is refused.
  • in OpenSSH or PEM form. A PuTTY key (.ppk) is refused. Convert it first with puttygen key.ppk -O private-openssh -o key, then paste the new file.
  • without a passphrase. A key protected by a passphrase is refused, because the agent cannot unlock it.

Paste the whole key, with all its lines. A refused key shows "Paste the private key itself, unencrypted, in OpenSSH or PEM form" under the field, and nothing is saved.

On the storage's page, Private key is empty because the panel never shows it again. Leave it empty to keep the stored key.

The host key

The host key lets the agent and the panel check that they talk to your real server. With Host key blank, the panel fetches it when you click Test connection or save the storage, and again when you change the Host or Port. You can also click the refresh icon on the Host key field to fetch it at once.

From then on, the agent and the panel connect only while the server presents that key. This covers uploads, Test connection, browsing, downloads and retention deletes.

Without a host key, both refuse the storage. If the panel cannot reach the server on save, the storage is saved without a key, and a Saved without a host key message says so. Click Test connection or the refresh icon on Host key, and save again.

An SFTP storage saved before the panel checked host keys, and never given one, is refused too. Open it, click Test connection or the refresh icon on Host key, and click Save changes.

Until a key is saved, downloads, retention deletes and the API's connection test refuse a storage without one. Only Test connection in the panel fetches a missing key, and only into the form: click Save changes to keep it.

You can also paste the key yourself, as one line in the form ssh-ed25519 AAAA…. The agent asks the server for an ECDSA key first, then RSA, then Ed25519. Paste the first of these types your server has, or the key will not match.

Through the API, send the key as config.host_key, one line such as the output of ssh-keyscan. A storage created without it is saved, but neither the agent nor the panel connects to it until a key is set.

What Test connection proves

The test runs from the Clokeep panel, not from your server. A pass proves that the panel can sign in. It does not prove:

  • that your servers can reach the SSH port. A server behind a different firewall still fails.
  • that the account may write to the Root path. The test writes nothing.

To check uploads, run a backup with Run now once the storage is on a plan. Clokeep also tests each active storage every hour and raises a Storage unreachable alert when the test fails.

Change the credentials

On the storage's page, Credentials shows "Stored encrypted. Leave a secret blank to keep the saved one." Type a new password or paste a new key only to replace the stored one.

Troubleshooting

ssh: host key mismatch

The server's host key changed, for example after a reinstall or a move. Every upload fails with an error that contains this text. The agent does not retry it. If the plan has another storage, the agent moves to that one at once. The panel refuses the storage too, so Test connection, browsing and downloads fail.

To pin the new key:

  1. Find out why the key changed. A key that changes without a reason can mean that something else answers in your server's place.
  2. Open the storage, clear the Host key field and click Save changes. The panel fetches the new key and shows Host key pinned.
no host_key pinned and insecure host keys are disabled

The storage has no host key, so the agent refuses it, and moves to the plan's next storage at once. The panel shows "No SSH host key is pinned for …" for the same reason. Open the storage, click Test connection or the refresh icon on Host key, and click Save changes.

Next steps

Esc
↑↓to navigate↵to openEscto close