VPS with ppk file

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
cybsistemas
Posts: 118
Joined: Mon 12 Sep 2005 17:31
Location: Argentina

VPS with ppk file

Post by cybsistemas » Thu 27 Apr 2017 01:23

Hi
Using delphi XE7, secure bridge 8.01 pro and Mydac 9.01 pro
How can I do to connect to a VPS using a ppk file instead of user and password?

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: VPS with ppk file

Post by ViktorV » Thu 27 Apr 2017 13:02

To solve the issue, you should set the TScSSHClient.Authentication property to atPublicKey and the TScSSHClient.PrivateKeyName property to valid key name after importing the ppk file. Example:

Code: Select all

procedure Connect;
var
  Key: TScKey;
begin
  Key := TScKey.Create(ScFileStorage.Keys);
  Key.KeyName := 'key1';
  Key.ImportFrom(Filename);

  ScSSHClient.Authentication := atPublicKey;
  ScSSHClient.KeyStorage := ScFileStorage;
  ScSSHClient.PrivateKeyName := 'key1';
  ScSSHClient.Connect;
end;

Post Reply