0 votes
by (120 points)

I've downloaded TinySftpServer C# sample, and when the server starts and tries to load users public keys, which are open ssh, I get an error:
User public key 'C:\Keys\public\pubOpenSsh.key' could not be loaded: Data too long.

Please advise.

Applies to: Rebex SFTP

1 Answer

0 votes
by (147k points)
edited by

UPDATE:

From version 1.0.5 authorized_keys format is supported as well (in this case name the file authorized_keys).


How does the public key file look like?

We support two formats - a raw binary format, and a Base64-encoded format that looks like this:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "rsa-key-20161118"
AAAAB3NzaC1yc2EAAAABJQAAAQEAwAdg3eizKcQ5INIMJOL3mIkRbv5QR6uQAdpM
dBr3AZOVdhJUs76/JXbDqvJJGI5s29Bp0pnAhgTA8FZAjE63lGq7/t1Ovzjt0RDD
4IT+9fRXTye+CCHpN1vcYmiQcFzkyS6qyxTrSumP2zsGPczi9DVMoRXqPV2/10g9
8531mJFMed28zl5AK5lSUQQN5b1LIINYf89OUxB8ElObJGowQlHelNtH/2PAN9tF
0dfLlUIewRhHM6zLoIo5JvXtn/QQcP/+za/zHe6zgOhwvG/QS7Cz1z7uuNzwKund
2GadgpcAjLOWavMXncZKofRP/7vAgGpT9AER41y3vcGqfTUbXQ==
---- END SSH2 PUBLIC KEY ----

(The raw binary format is equivalent to Base64-decoded form of the encoded public key.)

If your public key is using any other format, could you please post it here or mail it to support@rebex.net?

by (120 points)
Hi, I'm using the following format:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAxmZNRUgGlZCp39dzNeYyQxXhx/+dHZaVqvRjDQvBSW4FX0nkCRvM6f96FpW0bg7wBA81lLzPvxlKmHt8/Mr9xbcClGwaumXBbXRy/j04BOVIMZrQ7VchG2BvqSDsHunTCaPNYIO3mDA5qQYNc2uWOkErVGmSXmklb4FCdk3/OZ1dDmMR94xYmVxdx6cNwLLlErG1P/xvVGdaiyEFh0B7CWVNjlQmzTN3e1S60Ceeb+aHoxffiQeUoJJaR+ye4j5EBvGbnXbEY4DKe6u4u0LnBSj9gswtjZFTEdGl0zXXNODea4XeqbWejyw9dp9uTaQ7kMmyIzyjsD9ZwGPvmpkhOw== rsa-key-20161117
by (147k points)
edited by
UPDATE: from version 1.0.5 authorized_keys format is supported.

This format can be converted to a supported one manually using a text editor by splitting the value and adding header and footer. Please try this:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: rsa-key-20161117
AAAAB3NzaC1yc2EAAAABJQAAAQEAxmZNRUgGlZCp39dzNeYyQxXhx/+dHZaVqvRj
DQvBSW4FX0nkCRvM6f96FpW0bg7wBA81lLzPvxlKmHt8/Mr9xbcClGwaumXBbXRy
/j04BOVIMZrQ7VchG2BvqSDsHunTCaPNYIO3mDA5qQYNc2uWOkErVGmSXmklb4FC
dk3/OZ1dDmMR94xYmVxdx6cNwLLlErG1P/xvVGdaiyEFh0B7CWVNjlQmzTN3e1S6
0Ceeb+aHoxffiQeUoJJaR+ye4j5EBvGbnXbEY4DKe6u4u0LnBSj9gswtjZFTEdGl
0zXXNODea4XeqbWejyw9dp9uTaQ7kMmyIzyjsD9ZwGPvmpkhOw==
---- END SSH2 PUBLIC KEY ----

We will consider adding support for OpenSSH's ~/.ssh/authorized_keys format as well in one of the future releases.
by (120 points)
Thanks. Any ideas when you could support open ssh format?
by (147k points)
No promises on this, but it sounds quite useful. It will most likely make it into the release following the next one.
...