borg-backup-ui icon indicating copy to clipboard operation
borg-backup-ui copied to clipboard

Support Borg-only / restricted SSH servers (borg serve)

Open m4tr1ck opened this issue 3 months ago • 7 comments

I installed your plugin into my Unraid server and tried to connect to another Unraid server with BorgServer (https://hub.docker.com/r/nold360/borgserver) from the community apps. The setup of the Borg server seems to work, but with the SSH profile, I cannot test it. The SSH test and the Borg available test are ok, but the test for the repo path and the write test are not working.

Should I switch to make use of SMB / SSH directly without the usage of the Borg server? Or is there any way to support the borgserver?

I noticed that this plugin supports Hetzner storage boxes, which also allows to access the Borg server via SSH. I had set up 3 Ubuntu servers to backup via storage boxes.

If I try to connect to the Borg server via its defined port, like 2222, and it has the pub-key. The connection directly provides you with access to the Borg tool and takes the commands you give it.

Or should I rather make use of SSH and SMB?


"Show Details" provides me this information on "Test connection":

usage: borg [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug]
            [--debug-topic TOPIC] [-p] [--iec] [--log-json]
            [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc]
            [--umask M] [--remote-path PATH] [--remote-ratelimit RATE]
            [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER]
            [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
            [--debug-profile FILE] [--rsh RSH]
            <command> ...
bor

m4tr1ck avatar Aug 25 '26 22:08 m4tr1ck

Thanks for the detailed report. I think I understand what is happening here.

The "borgserver" container uses a restricted SSH setup where the SSH key directly launches "borg serve". Therefore it does not provide a normal shell.

That explains why the SSH connection itself works, while the repository path and write tests fail. Those tests currently expect a normal SSH shell and perform filesystem checks which are not possible with a Borg-only SSH connection.

So I would not recommend switching to SMB just because of this. Using Borg directly over SSH with "borg serve" is actually a perfectly valid and clean setup.

I think the better solution is to extend Borg Backup UI to support this type of Borg-only / restricted SSH server. In that mode, the UI should skip normal filesystem tests and validate the repository using Borg commands instead.

This would also make the implementation compatible with other Borg servers using a restricted SSH key such as:

"command="borg serve --restrict-to-path ...""

So this should not need to be a special implementation only for the "nold360/borgserver" container.

I'll take a closer look at how we can integrate this cleanly into the SSH storage target.

TheTwist76 avatar Aug 25 '26 22:08 TheTwist76

Implemented in PR #419 and available for testing in the next test-channel version: 2026.08.27.1826.

What changed:

  • SSH storage profiles now include a new target type: Borg Server.
  • Selecting Borg Server automatically enables the restricted SSH / borg serve behavior internally.
  • Shell-based checks such as remote path checks, remote borg --version, and write probes are skipped for Borg Server targets because these servers do not provide a normal SSH shell.
  • Repository access is validated with Borg itself during repository import or creation.
  • Repository directory browsing is disabled for Borg Server targets because browsing requires a remote shell.

borg-codex-bot avatar Aug 27 '26 16:08 borg-codex-bot

Reopened intentionally after PR #419 was merged.

The implementation is merged, but this issue should stay open until the Borg Server target type has been confirmed with the reported restricted SSH / borg serve setup.

borg-codex-bot avatar Aug 27 '26 16:08 borg-codex-bot

This change is now included in release 2026.08.27.1844 and can be tested from that version onward.

It adds the new Borg Server target type for SSH storage profiles, intended for restricted SSH targets that only allow Borg repository access without a normal shell.

I would be happy to get feedback on whether this works for your setup.

borg-codex-bot avatar Aug 27 '26 17:08 borg-codex-bot

@m4tr1ck I would be happy to get feedback on whether this works for your setup.

TheTwist76 avatar Aug 29 '26 21:08 TheTwist76

My first test to set it up was successful. Before my first test I had to update unraid to support the ssh parameter WarnWeakCrypto which firstly caused errors. After the update everything worked.

I tested the repo creation of two repos with a job for every repo including a restore of some files.

Thank you for the fast implementation.


For your information: With the parameter it requires open ssh with version 10.1 or higher which comes with unraid 7.2.0.

m4tr1ck avatar Aug 30 '26 07:08 m4tr1ck

Thank you for testing this so thoroughly and for confirming that the setup works. It is great to hear that creating two repositories, assigning a separate backup job to each repository, running the backups, and restoring files all completed successfully. Thank you also for the important compatibility note regarding WarnWeakCrypto. This SSH option requires OpenSSH 10.1 or newer, which is available with Unraid 7.2.0. Older Unraid versions may report an unsupported SSH option when this parameter is configured. Since the requested workflow has now been successfully verified, this issue can be closed. Thank you again for the detailed feedback and testing.

TheTwist76 avatar Aug 30 '26 08:08 TheTwist76