ssh authorized_keys gets corrupted when adding ed25519 keys
Observed with two FreeNAS 9-3-STABLE machines. I was setting up an rsync task on BoxA to pull data from BoxB to BoxA. In this case, I'm using root on both machines. In the field Account => Users => root => SSH Public Key on both machines there are already a number of rsa and dsa public keys listed, but no key for root@BoxA.
So on BoxA, I generated a new passwordless key: # ssh-keygen -t ed25519
On BoxB, I then went to modify the authorized_keys file via the UI sequence mentioned above. I cut&paste the contents of the ~root/.ssh/id_ed25519.pub file from BoxA into the "SSH Public Key" field on BoxB, appending it to the previous entries, and saved the changes.
Testing ssh in the shell from BoxA to BoxB failed. Examination of the ~root/.ssh/authorized_keys file on BoxB shows that the UI appended the key, but trimmed out the newline between that key and the previous one. I tried it a few more times to ensure that it wasn't operator error; the edit box initially has a newline before the ed25519 key, but upon save the newline is removed.
Perhaps is there something in the UI code that understands 'ssh-dss', 'ssh-rsa', but not 'ssh-ed25519', and is trying to reformat that file accordingly? If so, perhaps it should be looking for the equivalent of regex 'ssh-\S+' instead.
The original authorized_keys file before editing consisted of 4 ssh-rsa keys, 3 ssh-dss keys, and was 3957 bytes long. The id_ed25519.pub file is 100 bytes long.
I finally avoided the problem by switching to an rsa key for this purpose.