Topic "Preparation Required for an SFTP Script"

Author Message
[View user's profile]

Joined: 2012-09-19
Posts: 1
Location: Hong Kong

My vendor has created an account for me to access their SFTP server. I had created an script but could not pass the password authentication.

Below are the information provided by the vendor:

1. account name
2. SFTP server IP address and port number
3. private key(ppk)(no Encryption)

What I have done were:
1. Use PuTTY Key Generator to generate the Key Fingerprint:
- open PuTTY Key Generator
- Load the private key file
- select key type = SSH-2 RSA (1024 bits)
- NOTE: I have not enter a Key passphrase
- Generate
- copy the generated Key fingerprint and copy as -hostkey as shown
2. Create a script to connect to the SFTP server:
- open sftp://myaccount@ -hostkey="ssh-rsa 1024
3. Received an authentication error as shown in the log file attached.

My questions are:
a. do I need the vendor to create the account password and embed it
in the open statement?
b. if not, how can I resolve the authentication problem.

Thanks in advance.

Alex Yau
winscp_out.log (3.18 KB) [Download]

Description: (none)

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26889
Location: Prague, Czechia
1) You need to use -privatekey to specify a path to your private key.
2) In -hostkey you specify fingerprint of server's public key, not your private key.

No need to your step 1.
Martin Prikryl

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License