Skip to main content

CLI tool for common tasks with a Hetzner Storage Box.

Project description

📦 hsbt — Hetzner Storage Box Tool

One scriptable CLI (and typed Python library) for Hetzner Storage Boxes — from first SSH key deployment to permanent system mounts.

PyPI Python License: MIT Integration Tests GitHub


✨ Highlights

  • 🔌 4 mount backendsrclone (recommended · why), sshfs, CIFS/SMB, WebDAV over HTTPS
  • ♻️ 3 persistence styles — fstab · systemd automount · autofs
  • 🔑 Password-free after setup — deploys an SSH key once, then it's key-only forever
  • 🔄 One-way & bidirectional sync via rclone
  • 📤 SCP transfer & remote commands out of the box
  • 🐍 Importable Python library — every operation is typed and reusable

🚀 Quick start

pip install hsbt

# Save a connection (prompts for your password once to deploy an SSH key)
hsbt set-connection -i mybox -h u000001.your-storagebox.de -u u000001

# Mount it (default backend: rclone)
hsbt mount -i mybox --mount-point /mnt/mybox

# Make it survive reboots
sudo hsbt mount-perm -i mybox --mount-point /mnt/mybox

# Sync the whole box to a local directory
hsbt sync -i mybox --local-dir ~/backup/mybox

After the first set-connection the password is never needed again. With only one saved connection, -i mybox is optional everywhere.

🧰 Commands

Command Does
set-connection · list-connections · repair-connection · delete-connection Manage saved named connections
mount · mount-perm · unmount Temporary and reboot-persistent mounts
sync One-way or bidirectional sync via rclone
upload · download · available-space File transfer & disk usage

Run hsbt --help or hsbt <command> --help for every option.

📥 Installation

pip install hsbt          # from PyPI
pdm add hsbt              # or with PDM

System dependencies (Debian/Ubuntu — install only what you use):

apt install openssh-client sshpass   # always needed
apt install rclone                   # --mount-tool rclone / webdav / sync
apt install sshfs                    # --mount-tool sshfs
apt install cifs-utils               # --mount-tool cifs
apt install autofs                   # --mount-style autofs

Requires Python 3.14+. After install, hsbt is on your PATH.

💡 More examples

# Mount via HTTPS WebDAV (when SSH/SMB ports are blocked)
hsbt mount -i mybox --mount-point /mnt/mybox --mount-tool webdav --webdav-password secret

# On-demand mount, auto-disconnect after inactivity
sudo hsbt mount-perm -i mybox --mount-point /mnt/mybox --mount-style systemd-automount

# Bidirectional sync (keeps both sides in step)
hsbt sync -i mybox --local-dir ~/mybox-mirror --mode bisync

📚 Documentation

Document Audience
User Guide Every command, option, and environment variable
Mount Backends Choosing sshfs / rclone / CIFS / WebDAV, per-backend setup
Python API Using hsbt as a library
Development Guide Architecture, adding commands/backends, contributing
Testing Guide Unit tests, integration tests, CI setup

⚙️ How it works

hsbt stores named connections in a JSON config file (default ~/.config/hetzner_sbt_connections.json), each holding a hostname, username, and SSH keypair path. The first set-connection prompts for your password and deploys your public key via ssh-copy-id; from then on every operation is key-only and the password is never stored.

📄 License

MIT © Tim Bleimehl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hsbt-0.1.0.tar.gz (54.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hsbt-0.1.0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file hsbt-0.1.0.tar.gz.

File metadata

  • Download URL: hsbt-0.1.0.tar.gz
  • Upload date:
  • Size: 54.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.28.0 CPython/3.14.6 Linux/6.17.0-1018-azure

File hashes

Hashes for hsbt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aac6939bc9e485a057afc236447f96fe1a234dd31b15f6fdd08c9c50ea709336
MD5 ed7cc5035e89781a69baed79bcf143d8
BLAKE2b-256 23a06a33f98d9e0125ef7c739968c4863234209f578a18cf8c6d5ae725bca295

See more details on using hashes here.

File details

Details for the file hsbt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hsbt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.28.0 CPython/3.14.6 Linux/6.17.0-1018-azure

File hashes

Hashes for hsbt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8195a72fccbf66bd22d2be8e930b79231faf1fce28b7cf8e3d63489e3756b09
MD5 597a5dd57cba2f2bc13d43cc8fad429e
BLAKE2b-256 51969207218880f5bf72ccdc6a110b0501fc7cdfe4994e0c96d8abebb0d744e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page