The Connect(hostname, port, parameters)
overload is deprecated. It is not available in itellisense, but you can still use it. The correct (not deprecated) way is to set the parameters using the Settings
property:
sftp.Settings.SshParameters = parameters;
sftp.Connect(serverHost, serverPort);
However, setting the AuthenticationMethods
parameter would not help, the component supports Any
method by default and setting the AuthenticationMethods
is rather used to reduce the set of allowed methods.
If you are reciving the message Authentication method not supported. Supported methods: 'publickey', there is something wrong either in the server or in the component. Could you, please, create a Debug communication log and post it here or send it to support@rebex.net. We would try to find out, what is wrong in the authentication process.