SFTP Remote Backup Fails on SFTP-only Destinations (Hetzner Storage Box, etc.)

Thank you for reporting this issue. I’ve implemented a fix that adds support for SFTP-only destinations like Hetzner Storage Box.

What was the problem:

CyberPanel was trying to execute SSH shell commands (like mkdir -p .ssh, chmod, etc.) which are not supported on SFTP-only servers, causing the “Channel closed” errors.

What the fix does:

  • The system now attempts SSH commands first (maintaining backward compatibility)
  • If SSH commands fail or are rejected, it automatically falls back to pure SFTP operations
  • File transfers will use SFTP instead of SCP when SSH is not available
  • Directory creation and file operations are handled via SFTP protocol

Changes made:

  1. Modified setupSSHKeys to detect and handle SFTP-only servers
  2. Updated backup transfer mechanisms to use SFTP when SCP fails
  3. Added fallback for directory operations using SFTP
  4. Improved error handling to gracefully handle SFTP-only environments

The fix is implemented in CyberPanel v2.4.2. For those using SFTP-only destinations:

  • Password authentication will work seamlessly
  • The system will automatically detect the SFTP-only environment
  • Backups will be transferred using pure SFTP protocol

This ensures CyberPanel works with both regular SSH servers and SFTP-only destinations like Hetzner Storage Box, rsync.net, and similar services.

The fix maintains full backward compatibility - existing setups will continue to work exactly as before.

You can upgrade to get the fix.