Hi!:
I have to say that I'm a novice in SFTP programation.
I'm having troubles connecting to a freeFTPd server.
I'm using a private key generated with Rebex KeyGenerator_VB (PKCS #8 without Passphrase)
This is my code:
...
Dim privateKey As New SshPrivateKey("Cafe.pri", "")
Dim fingerprnt As String = ""
fingerprnt = client.Fingerprint.ToString
If p_finger.ToString.Equals(fingerprnt) Then
client.Login(p_user, p_pass, privateKey)
End If
...
And the Login function returns this message:
"Rebex.Net.SftpException: A public key
corresponding to the supplied private
key was not accepted by the server or
the user name is incorrect. --->
Rebex.Net.SshException: A public key
corresponding to the supplied private
key was not accepted by the server or
the user name is incorrect. at
Rebex.Net.SshSession.1QmUCN(String ,
String , SshPrivateKey ,
SshGssApiCredentials ) at
Rebex.Net.SshSession.Authenticate(String
userName, String password,
SshPrivateKey privateKey) at
Rebex.Net.Sftp.Login(String userName,
String password, SshPrivateKey
privateKey) --- End of inner
exception stack trace --- at
Rebex.Net.Sftp.Login(String userName,
String password, SshPrivateKey
privateKey) at
Rebex.Net.Sftp.Login(String userName,
SshPrivateKey privateKey)"
The user and password are fine, because I connect without key and I don't have any problem. And I'm using the same PrivateKey file in both sides, client and server (Cafe.pri)
Could you help me, please?
It's a problem with the private-key, or is the SFTP server?
What I am doing wrong?
Thanx a lot in advance.