Why I am getting below error on connecting to sftp server via Rebex?

+1 vote
asked Aug 10, 2016 by alexander.junior (180 points)

I have generated a private key and public key pair.I am trying to authenticate via a sftp server tool

            // connect to a server and verify fingerprint
            var client = new Sftp();
            client.Connect("Test-222");

            // load the private key
            SshPrivateKey privateKey = new SshPrivateKey(@"\\Test-222\Alex\MyData\my_key.ppk", "key_password");

            // log in
            client.Login(username, privateKey);

No suitable authentication method is supported. Supported methods: 'password'.

Applies to: Rebex SFTP

1 Answer

0 votes
answered Aug 10, 2016 by Tomas Knopp (58,580 points)

The private key authentication is not accepted by your SFTP server because your SFTP server is configured to only accept password authentication. You'll neeed to enable private/public key authentication at your server first. An exact way to do this depends on the server type. Please consult your SFTP server vendor.

commented Aug 10, 2016 by alexander.junior (180 points)
I am using sftp  server tool exe. How to test the same in this before making it on a certified sftp server?
commented Aug 10, 2016 by Tomas Knopp (58,580 points)
Do you mean Rebex Tiny Sftp server? http://labs.rebex.net/tiny-sftp-server
commented Aug 11, 2016 by alexander.junior (180 points)
I am using Core FTP mini SFTP server
commented Aug 11, 2016 by alexander.junior (180 points)
I tried with Rebex Tiny SFTP Server. I am able to connect on passing username and password. Also possible by passing username,password and privatekey.
client.Login(username,password);
 client.Login(username,password,privateKey);

         
But issue occurs on passing username and private key.
client.Login(username,privateKey);
No suitable authentication method is supported. Supported methods: 'password,keyboard-interactive'.
commented Aug 15, 2016 by Tomas Knopp (58,580 points)
Hello, please download the newer beta version of Rebex Tiny Sftp server that now supports user public key authorization from http://www.rebex.net/getfile/3b5706c03fb440b7a3a4db722891e02e/RebexTinySftpServer-with-public-key-auth-Bin.zip and give it a try.
commented Aug 17, 2016 by alexander.junior (180 points)
it is working with private key authentication.I want the source code for the mentioned beta version of SFTP Tool.
...