Topic ".Net Library Can't get connection to server"

Author Message
Roxxinger
[View user's profile]

Joined: 2013-04-02
Posts: 3
Hi,

dont know what to to. Getting a WinSCP.SessionRemoteException: Rechner-Schlssel wurde nicht berprft! etc...

My code:
Code:
 SessionOptions sessionOptions = new SessionOptions
                    {
                        Protocol = Protocol.Sftp,
                        HostName = "ftp.de",
                        UserName = "user",
                        Password = "pwd",
                        SshHostKeyFingerprint = "ssh-rsa 1023 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx",
                                            };

                    using (Session session = new Session())
                    {
                        // Connect
                        session.Open(sessionOptions);
                    }

What am i doing wrong? I also tried adding the Path to the sshprivatekeyfile:
Code:
SshPrivateKeyPath = "C:\\temp\\",
but nothing changed.

Maybe someone can help me, didnt find something related in the FAQ, as far as i can see...
Advertisements
Roxxinger
[View user's profile]

Joined: 2013-04-02
Posts: 3
ok enabled logging, getting another fingerprint... switch to them getting now such an error
Code:
. 2013-04-10 09:32:54.330 Looking up host "ftp"
. 2013-04-10 09:32:54.330 Connecting to xxx.xxx.xxx.xxx port 22
. 2013-04-10 09:32:54.408 Server version: SSH-2.0-OpenSSH_4.3
. 2013-04-10 09:32:54.408 Using SSH protocol version 2
. 2013-04-10 09:32:54.408 We claim version: SSH-2.0-WinSCP_release_5.1.4
. 2013-04-10 09:32:54.455 Doing Diffie-Hellman group exchange
. 2013-04-10 09:32:54.549 Doing Diffie-Hellman key exchange with hash SHA-1
. 2013-04-10 09:32:54.720 Verifying host key rsa2 0x23,0xd with fingerprint ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:x:xx:xx:xx:xx:xx:xx:xx
. 2013-04-10 09:32:54.720 Host key matches configured key
. 2013-04-10 09:32:54.720 Host key fingerprint is:
. 2013-04-10 09:32:54.720 ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:x:xx:xx:xx:xx:xx:xx:xx
. 2013-04-10 09:32:54.720 Initialised AES-256 SDCTR client->server encryption
. 2013-04-10 09:32:54.720 Initialised HMAC-SHA1 client->server MAC algorithm
. 2013-04-10 09:32:54.720 Initialised AES-256 SDCTR server->client encryption
. 2013-04-10 09:32:54.720 Initialised HMAC-SHA1 server->client MAC algorithm
. 2013-04-10 09:32:54.829 Reading private key file "c:/temp/key.ppk"
! 2013-04-10 09:32:54.829 Using username "username".
. 2013-04-10 09:32:54.861 Offered public key
. 2013-04-10 09:32:55.235 Offer of public key accepted
! 2013-04-10 09:32:55.235 Authenticating with public key "public key"
. 2013-04-10 09:32:55.235 Prompt (3, SSH key passphrase, , Passphrase for key "public key": )
. 2013-04-10 09:32:55.235 Disconnected: Unable to authenticate


How to define the passphrase?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Please read last section of
http://winscp.net/eng/docs/faq_passphrase
_________________
Martin Prikryl
Roxxinger
[View user's profile]

Joined: 2013-04-02
Posts: 3
Sad is it such a security issue if the password is stored in the c# code? It is compiled and running on a protected server...
dhgancarz
[View user's profile]

Joined: 2013-07-01
Posts: 1
Location: Orlando, FL
I too have a private key protected with a passphrase. Pageant did the trick with

Code:
SessionOptions sessionOptions = new SessionOptions
                {
                    Protocol = Protocol.Sftp,
                    HostName = "host.com",
                    UserName = "username",
                    //Password = "xxx...xxx",
                    //SshPrivateKeyPath = @"xxx.ppk",
                    SshHostKeyFingerprint = "ssh-rsa 2048 ..."
                };

Thank you, Sir.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License