We bought securebridge, so we are using the commercial licensed version. I have yet to get anything working.
The above documentation links give 404 errors.
I figured out how to change the port, but I am getting a SHA error when I try to connect.
This is all very complex for a simple procedure. I just want to send and receive files through an ssh tunnel (hence the sftp).
I do not understand the relationship between the filestore, ssh client and sftp client. I know you need all 3 on the form, but how do you set them up to SFTP a file?
Right now, I have this code:
Code: Select all
ScFileStorage := TScFileStorage.Create(nil);
ScSSHClient := TScSSHClient.Create(nil);
ScSSHClient.KeyStorage := ScFileStorage;
ScSSHClient.Port := 522;
//ScSSHClient.OnServerKeyValidate := ScSSHClientServerKeyValidate;
ScSSHClient.HostName := serverHostName;
ScSSHClient.User := serverUsername;
ScSSHClient.Password := serverPassword;
ScSSHClient.Connect;
ScSFTPClient := TScSFTPClient.Create(nil);
ScSFTPClient.SSHClient := ScSSHClient;
ScSFTPClient.Initialize;
ScSFTPClient1.UploadFile(varUploadFile, varServerFile, True);
//ScSFTPClient.DownloadFile(varDownloadFile, varDownloadFile, False);
ScSSHClient.Disconnect;
Code: Select all
procedure TfrmRubidexCoreTechDemo.ScSSHClientServerKeyValidate(Sender: TObject; NewServerKey: TScKey; var Accept: Boolean);
begin
Accept := True;
end;
As a result, I commented out this line because it gave me errors:
//ScSSHClient.OnServerKeyValidate := ScSSHClientServerKeyValidate;
I get a sha256 error when I run this (yes, the port is correct). The variables (serverHostName, serverUsername, serverPassword, etc) are filled in above this code and are correct.
I have not defined any keys because I do not understand that part. I do not understand how a server should have a key and then it should match in the program. In other languages, I would just use ssh commands and they would just work. Yours seems to require too much configuration just to get started.
Is there an easy way to simply send and receive files through ssh?
Mike