Whitepaper técnico — PodHeitor SFTP para Bacula

Backup agentless via SFTP/SSH, zero deployment no host remoto, suporte a network equipment (Cisco/Juniper/MikroTik/…), NAS (Synology/QNAP/TrueNAS), cloud SFTP (AWS Transfer, Hetzner Storage Box), e cloud VMs. Substitui mountpoints SSHFS/NFS/CIFS frágeis com conexões SFTP per-job sem estado stale.

Documento técnico complementar à página do plugin PodHeitor SFTP.

1. Problema: SSHFS/NFS/CIFS mountpoints são frágeis

O padrão tradicional de “backup remoto sem agente Bacula” é montar o filesystem remoto via SSHFS/NFS/CIFS no host do FD. Isso parece simples mas falha em campo de várias formas:

Problema do mountpoint Vantagem do SFTP
SSHFS/NFS/CIFS mounts ficam stale → backups falham silenciosamente SFTP abre conexão fresh per job — sem state stale
Mount requer FUSE ou kernel module no host do FD SFTP/SSH é pure userspace (Rust ssh2 / libssh2) — sem deps de kernel
Credenciais armazenadas em /etc/fstab ou systemd mount files Credenciais ficam na config do Bacula, encriptadas em rest
Mount expõe o filesystem inteiro para o host do FD SFTP escopa acesso ao path — sem mount surface local
NFS/CIFS firewalling é complexo (portmapper, SMB ports) SFTP/SSH = single TCP port (22), facilmente firewalled
Mounts stale bloqueiam o processo FD (hung stat calls) SFTP timeout é per-operation — nunca bloqueia o daemon
Network devices (switches, routers, firewalls) não podem ser montados SFTP/SSH é nativo em network equipment
Cloud SFTP services (AWS Transfer, Hetzner Storage Box) Conexão SFTP direta — sem mount layer

2. Modelo arquitetural

┌──────────────┐     PTCOMM protocol      ┌──────────────────────────┐
│  Bacula FD   │◄═══════════════════════►  │ podheitor-sftp-backend   │
│              │     (stdin/stdout)         │ (Rust + libssh2)         │
│ loads .so:   │                           │                          │
│ podheitor-   │   Handshake → Job Info    │ connect() → walk() →    │
│ sftp-fd.so   │   → Params → Start →     │ FNAME/STAT/DATA →       │
│ (Rust cdylib,│   ← file data ←          │ filtros include/exclude  │
│ metaplugin-  │                           │                          │
│ rs)          │                           │                          │
└──────────────┘                           └──────────────────────────┘

Mesma arquitetura PodHeitor de cdylib + backend. O backend hospeda o cliente SFTP (libssh2 via Rust ssh2), faz walk recursivo do path remoto, e streama metadata + data via PTCOMM. Sem disco intermediário; o FD recebe os bytes direto.

3. Features

  • Agentless — só SFTP/SSH, sem software no host remoto
  • Full / Incremental / Differential — níveis Bacula nativos via comparação de mtime
  • Filtros include/exclude — glob-based (*.pdf, *.tmp) por arquivo e diretório
  • Metadata preservada — permissões, UID/GID, timestamps, symlinks
  • Autenticação — SSH key (ed25519, RSA, ECDSA), agent forwarding, password
  • Host key verification — proteção MITM via known_hosts
  • File listingestimate (pré-backup), catalog queries, restore tree browsing
  • Multiple sources — N servidores SFTP num único FileSet
  • Compression & Encryption — LZ4/GZIP nativo Bacula + AES

4. Casos de uso documentados

4.1 Network equipment

Vendor Modelos / OS
Cisco Catalyst 9000 (IOS-XE), Nexus (NX-OS), ISR/ASR
Juniper EX, QFX, SRX, MX (Junos)
MikroTik Todos os RouterOS devices
Arista 7000, 7500 series (EOS)
HPE Aruba CX switches, Instant AP
Dell PowerSwitch (OS10)
Fortinet FortiGate (FortiOS)
Palo Alto PA series (PAN-OS)
Ubiquiti UniFi, EdgeRouter
Outros VyOS, OPNsense, pfSense

4.2 NAS e Storage

Synology DiskStation SFTP/SSH built-in (DSM)
QNAP SFTP/SSH built-in (QTS)
TrueNAS / FreeNAS SFTP/SSH built-in
Asustor, TerraMaster SFTP/SSH disponível

4.3 Cloud SFTP services

AWS Transfer Family Endpoint SFTP gerenciado
Azure Blob Storage SFTP access (preview/GA)
Hetzner Storage Box SFTP/SSH nativo (port 23)
Files.com, ExaVault, GoAnywhere MFT SFTP enterprise

4.4 Cloud VMs e hosting

AWS EC2, GCP Compute, Azure VMs, DigitalOcean, Linode, Vultr, Hetzner Cloud, OVH; cPanel/WHM, Plesk, DirectAdmin — qualquer hosting com SFTP/SSH.

4.5 Embedded e IoT

Raspberry Pi, IoT gateways — backup leve sem overhead de mount. Devices com storage limitado — sem layer FUSE/mount necessário.

5. Plugin parameters

Parameter Required Default Descrição
host yes Hostname ou IP do servidor SFTP
port no 22 Porta SFTP
user yes Username SFTP
password no Senha SFTP (prefira keyfile)
keyfile no Path da chave privada
passphrase no Passphrase da chave
path yes / Diretório base remoto
known_hosts no Path do known_hosts
verify_host no yes Verifica host key
timeout no 30 Connection timeout (segundos)
include no Glob patterns de inclusão (e.g. *.pdf,*.doc)
exclude no Glob patterns de exclusão (e.g. *.tmp,*.log)
abort_on_error no no Aborta job em erro de leitura

6. Quick start

# 1. Prepara chave para acesso SFTP
sudo mkdir -p /etc/bacula/.ssh
sudo ssh-keygen -t ed25519 -f /etc/bacula/.ssh/id_ed25519 -N ""
sudo ssh-copy-id -i /etc/bacula/.ssh/id_ed25519.pub [email protected]

# 2. Configura FileSet
FileSet {
  Name = "SFTP-Backup"
  Include {
    Options { Signature = SHA256; Compression = LZ4 }
    Plugin = "podheitor-sftp: host=server.local user=backup keyfile=/etc/bacula/.ssh/id_ed25519 path=/data"
  }
}

Job {
  Name     = "SFTP-Daily"
  Type     = Backup
  Level    = Incremental
  FileSet  = "SFTP-Backup"
  Client   = myserver-fd
  Storage  = File1
  Pool     = Default
  Schedule = "WeeklyCycle"
}

7. Examples include/exclude e multi-source

# Apenas PDFs e Office docs
Plugin = "podheitor-sftp: host=server user=backup path=/data include=*.pdf,*.docx,*.xlsx"

# Skip temp e cache
Plugin = "podheitor-sftp: host=server user=backup path=/data exclude=*.tmp,*.cache,*.log"

# Network switch — só configs
Plugin = "podheitor-sftp: host=10.0.0.1 user=admin path=/ include=*.conf,*.cfg verify_host=no"

# MikroTik — backup e export files
Plugin = "podheitor-sftp: host=10.0.0.3 user=admin path=/ include=*.backup,*.rsc verify_host=no"

Multi-source num único FileSet:

FileSet {
  Name = "AllServers"
  Include {
    Options { Signature = SHA256; Compression = LZ4 }
    Plugin = "podheitor-sftp: host=web1.prod user=deploy keyfile=/etc/bacula/.ssh/key path=/var/www exclude=*.log"
    Plugin = "podheitor-sftp: host=web2.prod user=deploy keyfile=/etc/bacula/.ssh/key path=/var/www exclude=*.log"
    Plugin = "podheitor-sftp: host=nas.local user=admin keyfile=/etc/bacula/.ssh/key path=/volume1/shared"
    Plugin = "podheitor-sftp: host=switch-core user=admin keyfile=/etc/bacula/.ssh/key path=/ include=*.conf verify_host=no"
  }
}

8. Restore

Restore opera no namespace @sftp/host:port/path:

bconsole
* restore where=/tmp/sftp-restore select all done yes

9. Requirements

Component Mínimo Notas
Bacula Community 13.0.0+ Metaplugin framework requerido
libssh2 / openssl system Runtime libs (system packages)
Remote host SFTP/SSH access Sem agent

10. License posture

Proprietary — LicenseRef-PodHeitor-Proprietary (tanto o .so FD-side quanto o backend). Nenhum código statically-linked third-party é AGPL ou outro copyleft. Dependências Rust transitivas (ssh2, libssh2-sys, libc, parking_lot, openssl-sys) são todas MIT / Apache-2.0.

Pronto para avaliar?

Trial gratuito de 30 dias para deployments SFTP qualificados (network equipment, NAS, cloud, embedded). Garantimos no mínimo 50% de desconto vs Bacula Enterprise, Veeam ou Commvault, com mais funcionalidades — incluindo agentless puro sem mountpoint frágil que o competidor força.

Heitor Faria — Fundador, PodHeitor International
[email protected]
☎ +1 (789) 726-1749 · +55 (61) 98268-4220 (WhatsApp)
🔗 Página do plugin PodHeitor SFTP

Disponível em: pt-brPortuguêsenEnglish (Inglês)esEspañol (Espanhol)

Deixe um comentário