Skip to content

Conversation

@oadiazp
Copy link

@oadiazp oadiazp commented Jan 2, 2026

Summary

Add a configurable option sftp_ignore_hostkey to allow users to disable SSH host key verification for SFTP connections.

Problem

When using SFTP backup method, connections fail with SSHException: No hostkey for host X found if the server's host key is not in the known_hosts file. This is a common issue reported in #782.

Solution

  • Add new boolean field sftp_ignore_hostkey (default: False)
  • When enabled, the SFTP connection skips host key verification
  • A warning is logged when verification is disabled
  • Security is maintained by default (verification enabled)

Changes

  • auto_backup/models/db_backup.py: Add field and modify sftp_connection() method
  • auto_backup/view/db_backup_view.xml: Add field to SFTP settings form
  • auto_backup/tests/test_db_backup.py: Add 3 new tests for the feature

Test Plan

  • Pre-commit hooks pass
  • New unit tests added
  • Manual testing with SFTP server

Closes #782

Add sftp_ignore_hostkey boolean field to allow users to disable
SSH host key verification for SFTP connections.

This resolves connection issues when the server's host key is not
in the known_hosts file, while keeping verification enabled by default
for security.

When enabled, a warning is logged to alert administrators that
host key verification is disabled.

Closes OCA#782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ 10 auto_backup] pysftp version may block backup

1 participant