Backup: PHP Exception on Missing SFTP Public Key
Open
@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:
- I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue
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:
- Configure a working sftp backup configuration
- Delete the SSH key under
~/.ssh/authorized_keys - 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.