Sftp server public key authentication problem

0
Users send me single-line style public rsa keys for their account public key authentications, but they don't work. The only public keys that work for me (RSA Ssh-2) look like this: ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "rsa-key-20210426" AAAAB3NzaC1yc2EAAAABJQAAAQEA0ei/S UGUdkaN04WJ0QOg0k/DoY/u bdj 9L ... SNwZO6AOJgnw7lgFNWbU5eso83qX 97o9tn64lWTAACfaMCVSQ== ---- END SSH2 PUBLIC KEY ---- Anything else faults in the logs showing: SftpServer: 1 Error - Info: Error: c_ck: Error while processing packet SSH_MSG_USERAUTH_REQUEST. ---> System.Security.Cryptography.CryptographicException: Invalid key format. I'm guessing that the single-line key format is meant for SSH-1 servers, but ComponentPro's is SSH-2. Or, am I missing a configuration setting or something?
edited 5/6/2021 8:05:05 AM
asked 5/6/2021 7:39:57 AM
add a comment

1 Answers

0
Here I go again... answering my own question. But revising it, so there is still a question. The SftpSshServer won't accept the OpenSSH style public key, rather, it requires an RFC 4716 compliant key. Fortunately it is very easy to modify by hand a single-line rsa OpenSSH key and make it into an RFC 4716 key. This works as long as the OpenSSH key is SSH-2 RSA when burned I would think. So, my question now is: It looks like ComponentPro lists OpenSSH compatibility, so is there a way to make the Sftp server accept OpenSSH public user keys for authentication? That way I won't have to keep tweaking the OpenSSH style keys people send me.
 
answered 5/7/2021 3:56:10 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged sftp server or ask your own question.