opnsense / opnsense/plugins

Backup: PHP Exception on Missing SFTP Public Key

Open
#5,238 0 comments 0 reactions 1 assignee View on GitHub

@AdSchellevis is already working on this.

Since Feb 19, 2026.

bug
Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

I was doing some maintenance and I deleted the SSH key used to backup configurations via SFTP. This caused PHP to throw an exception and log the following in Crash Reporter. A more user friendly message may be needed instead.

[15-Feb-2026 01:20:25 America/Chicago] PHP Fatal error:  Uncaught Exception: ** WARNING: connection is not using a post-quantum key exchange algorithm.

** This session may be vulnerable to "store now, decrypt later" attacks.

** The server may need to be upgraded. See https://openssh.com/pq.html

opnsense@host.domain.tld: Permission denied (publickey).

Connection closed

 in /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Sftp.php:174
Stack trace:
#0 /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Sftp.php(202): OPNsense\Backup\Sftp->sftpCmd('ls -lnt config-...')
opnsense/core#1 /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Sftp.php(251): OPNsense\Backup\Sftp->ls('config-*.xml')
opnsense/core#2 /usr/local/opnsense/scripts/system/remote_backup.php(17): OPNsense\Backup\Sftp->backup()
opnsense/core#3 {main}
  thrown in /usr/local/opnsense/mvc/app/library/OPNsense/Backup/Sftp.php on line 174

To Reproduce

Steps to reproduce the behavior:

  1. Configure a working sftp backup configuration
  2. Delete the SSH key under ~/.ssh/authorized_keys
  3. Make a configuration change that triggers a backup

Expected behavior

A message under System Status that says "Configuration backups via SFTP failed."

Environment

OPNsense 26.1.2-amd64
Intel(R) Core(TM) i3-N305

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.