Failed to user Key authentication for SFTP - WeOnlyDo Discussion board

Failed to user Key authentication for SFTP (wodSFTP / wodSFTP.NET / wodSFTPdll)

by tom, Wednesday, March 27, 2019, 08:40 (2066 days ago) @ Jasmine
edited by tom, Wednesday, March 27, 2019, 08:47

Hi Tom.

Who created the key? wodSFTP can try to read "alien" keys, but doesn't have to succeed. If they are in some 3rd party format, then it will fail to read it.

Jasmine.


Hi Jasmine,

Thanks!

The keys genereated by Tkeys object.

-----------------------------------------
var
k: TKeys;
begin
k := TKeys.Create(self);
k.Generate(RSAKey);
k.Save(RSAKey, 'private_key');

p := TStringList.Create;
p.Add(k.PublicKeyOpenSSH[RSAKey]);
p.SaveToFile('public_key');
end;

----------------------------------------------
The context of private key

-----BEGIN RSA PRIVATE KEY-----
MIICWwIBAAKBgQDBJdplJHxBVhismG5nK1oyfHiSm1FYZHa0qoMXti2PQEgnOwUK
--more--
4z9txiZTt9s3d6OT5XIae4+iz9ap5l1fTIPnsr4gwQ==
-----END RSA PRIVATE KEY-----

-----------------------------------------------
The context of public key for openSSH

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwSXaZSR8Q
--more--
S08HEd0QlxDYMgvX5USzv8oz6NQc0=

-----------------------------------------------
The running value of k.PrivateKey[RSAKey] by Watch

#0#0#0#7'ssh-rsa'#0#0#0'?'#0'?趀$|AV'#$18'瑯ng+Z2|x挍QXdv椽??廆H'';
--more--
6O?恳"QRuZ鬬'#$14'^`?m?S粉7w錼'#$1A'{彚现╂]_L冪簿 ?'

--------------------------------------------------
The running value of k.ToXmlString(RSAKey, true); by Watch

'<RSAKeyValue><Modulus>wSXaZSR8QVYYrJh
--more--
4YtMIZLg0Irqo6b4ZR+c=</D></RSAKeyValue>'

------------------------------------------------

TOM


Complete thread: