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.
Dear,
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
below
2. Create a script to connect to the SFTP server:
- open sftp://myaccount@10.6.109.135:22 -hostkey="ssh-rsa 1024
3d:5c:c8:dd:78:76:77:8b:66:64:61:71:6c:ec:67:05"
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