Jump to content


Photo

Connect with SSH and public key


This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1 donj91711

donj91711
  • Members
  • 15 posts

Posted 22 July 2011 - 07:33 PM

I am trying to connect to a client using SSH
They gave me an ID, but no password. Everything I will be ftp'ing to them will be encrypted with pgp, so they gave me a public key to use.
When I try to connect I get:

[20110722 18:35:57] SmartFTP FTP Library 2.0.86.0
[20110722 18:35:59] Resolving host name "<client host>"
[20110722 18:35:59] Connecting to <client ftp ip address> Port: 22
[20110722 18:35:59] SSH-2.0-XFB.Gateway Unix
[20110722 18:35:59] Starting SSH session. Remote Id: "SSH-2.0-XFB.Gateway Unix"
[20110722 18:35:59] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[20110722 18:36:00] Key Exchange Algorithm: diffie-hellman-group-exchange-sha1
[20110722 18:36:00] Key exchange completed.
[20110722 18:36:00] Host Key Algorithm: ssh-rsa
[20110722 18:36:00] Client to Server Encryption: aes128-cbc
[20110722 18:36:00] Server to Client Encryption: aes128-cbc
[20110722 18:36:00] Session MAC: hmac-sha1
[20110722 18:36:00] Client to Server Compression: none
[20110722 18:36:00] Server to Client Compression: none
[20110722 18:36:00] Requesting service "ssh-userauth".
[20110722 18:36:00] RTT: 199.428 ms
[20110722 18:36:00] Authentication request. Method: "none"
[20110722 18:36:00] Server supported authentications: publickey
[20110722 18:36:00] User authentication failed.
[20110722 18:36:00] Client closed the connection.
[20110722 18:36:00] 2

The code I am using is:
Public objSSH As sfFTPLib.SSHConnection
Set objSSH = CreateObject("sfFTPLib.SSHConnection")
objSSH.Host = "<ftp site>"
objSSH.Username = "<user id>"
objSSH.Password = ""
objSSH.Port = 22
ret = objSSH.Connect

I get ret code 25

I'm sure I'm missing something here. Am I supposed to refer to their public key somewhere before I try to connect?

#2 mb

mb

    Developer

  • Administrators
  • 11521 posts

Posted 22 July 2011 - 07:33 PM

Try it with the SmartFTP client first.