Trying to get the sFTP backups working. From opnsense cli, I can sftp to my server using the needed private key.
From the GUI, I get this error when using the same private key:
The following input errors were detected:
<user>@<server>: Permission denied (publickey). Connection closed
Any thoughts on what/where the issue may be?
When you pasted the private key into the GUI window while setting it up, did you make sure there were no line breaks? Remember, you paste the key into the backups page, just having the id_rsa in ~/.ssh isn't enough.
Yes, I made sure there are no line breaks. Here is an example of what I pasted:
-----BEGIN OPENSSH PRIVATE KEY-----
<key data>
-----END OPENSSH PRIVATE KEY-----
Matter-of-fact, there should be line breaks. However, there are different notions of what line breaks are:
Windows: CR LF
Unix: LF
MacOS: CR
See: https://forum.opnsense.org/index.php?topic=46350
Quote from: meyergru on July 28, 2025, 07:40:33 PMMacOS: CR
"Mac OS 9 was a friend to us all ..."
-- Steve Jobs at the Mac OS 9 funeral
Current Mac OS uses Unix convention. Naturally ;-)
I just noticed something very odd while digging into this. I have be doing this all from an EndeavourOS workstation.
My private key is 27 lines long, including the "Begin" and "End" text. When I copy the key into the OPNsense GUI, the total lines increases to 37.
I did a diff between the two and there is very little in common. The data is getting changed somehow.
Using a Windows workstation, I was able to successfully copy the correct key into the OPNsense GUI.