(bugfix) Use service-level known_hosts for generated SSH keys

When a selected SSH credential has no pinned known_hosts entries, create
and use a pobsync service-level known_hosts file under POBSYNC_HOME/state.

Pass UserKnownHostsFile and StrictHostKeyChecking=accept-new to SSH so
unattended backups no longer depend on root's known_hosts or an
interactive shell session.

Keep pinned credential known_hosts behavior unchanged when entries are
configured explicitly.
This commit is contained in:
2026-05-19 20:01:39 +02:00
parent d3ffca1843
commit 8bd2a8ff1a
3 changed files with 36 additions and 2 deletions

View File

@@ -69,8 +69,8 @@ def collect_host_checks(host: HostConfig, global_config: GlobalConfig | None = N
SelfCheck(
"Host known_hosts",
"warning",
"Selected credential has no known_hosts entries.",
"Use Scan SSH host key before queueing unattended backups.",
"Selected credential has no pinned known_hosts entries.",
"pobsync will use service-level StrictHostKeyChecking=accept-new on first connect.",
)
)