Skip to main content
October 17, 2024
Solved

SFTP Connection with PPK file

  • October 17, 2024
  • 1 reply
  • 0 views

Hi Everyone,

Has anyone worked on establishing an SFTP connection in extensibility rules using a PPK file? I am currently facing an issue where, despite setting the SshPrivateKeyPath property in the session options, I receive the error: "No supported authentication methods available (server sent: publickey)."

Any insights or solutions would be greatly appreciated.

Thank you,

Mithun

Best answer by mithun_laha

Hi Mithun,

Sure, this is the part I use for authentication: 

						    ' Setup session options with private key authentication
							        Dim sessionOptions As New SessionOptions()
							        sessionOptions.Protocol = Protocol.Sftp
							        sessionOptions.HostName = "host.com" ' Replace with your hostname
							        sessionOptions.UserName = "myuser"    ' Replace with your username
							        sessionOptions.SshPrivateKeyPath = $"File Share/XXXXX/New_Private_key_OS.ppk" 

									sessionOptions.SshHostKeyFingerprint = "YYYYYYY" 

 


Hi Kamila,

Could you please try the following in the SshPrivateKeyPath:

sessionOptions.SshPrivateKeyPath = $"{BRApi.Utilities.GetFileShareFolder(si, FileShareFolderTypes.ApplicationRoot, Nothing)}\AppName\ppk_file.ppk"


If the above does not work, could you also try adding the port number in the sessionOptions? 

Best regards,
Mithun

1 reply

February 26, 2025

Hi Mithun,

I have the same issue now, did you manage to solve it? Thanks!

February 26, 2025

Hi Kamila,

I hope this message finds you well.

Please follow the steps below to set up the SFTP connection:

  1. Save the .ppk file into the fileshare folder.
  2. Use the .ppk file in the sessionOptions variable (SshPrivateKeyPath) 

If you have any questions or need further assistance, please don't hesitate to reach out.

Thank you,
Mithun

February 26, 2025

Thanks Mithun, I already did that and still have the error:



Any ideas? Thanks!