* This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. loSftp = CreateObject('Chilkat_9_5_0.SFtp') * Load a .ppk PuTTY private key. loPuttyKey = CreateObject('Chilkat_9_5_0.SshKey') lcPpkText = loPuttyKey.LoadText("d:\ssh2\chilkat_rsa_priv.ppk") * "secret" is the actual password for the above PPK. loPuttyKey.Password = "Muehlematt" lnSuccess = loPuttyKey.FromPuttyPrivateKey(lcPpkText) IF (lnSuccess <> 1) THEN ? loPuttyKey.LastErrorText RELEASE loSftp RELEASE loPuttyKey CANCEL ENDIF lcSshHostname = "sftp.clnet.bpm.ch" lnSshPort = 22 SET STEP ON * Connect to an SSH/SFTP server lnSuccess = loSftp.Connect(lcSshHostname,lnSshPort) IF (lnSuccess <> 1) THEN ? loSftp.LastErrorText loSFTP.Disconnect() RELEASE loSftp RELEASE loPuttyKey CANCEL ENDIF * Authenticate with the SSH server using a username + private key. * (The private key serves as the password. The username identifies * the SSH user account on the server.) lnSuccess = loSftp.AuthenticatePk("ediholste",loPuttyKey) IF (lnSuccess <> 1) THEN ? loSftp.LastErrorText loSFTP.Disconnect() RELEASE loSftp RELEASE loPuttyKey CANCEL ENDIF ? "OK, the connection and authentication with the SSH server is completed." * This example is only to show the connection + authentication using a PuTTY private key... loSFTP.Disconnect() RELEASE loSftp RELEASE loPuttyKeyAnd the lasterortext is: