Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

MinJi Lee

After I changed ftp to sftp in the script, the error has been resolved! Thank you, @martin!
martin

Re: About ssh-rsa 4096 hostkey

Host keys are used with SSH/SFTP. Not with FTP. If you are connecting to an SFTP server, you need to change ftp:// to sftp://.
And remove all of -passive -explicitssl -explicittls -implicit, as they have no effect with SFTP (and they even contradict one another).

As it seems that you can connect with WinSCP GUI, you can have it generate a code template for you: https://winscp.net/eng/docs/ui_generateurl#script
MinJi Lee

About ssh-rsa 4096 hostkey

Hello, this is MinJi.

I was trying to access SFTP server using a script with the ssh-rsa 4096 hostkey. However, the access is denied. (The hostkey is from Server and Protocol Information Dialog session.)
Could you please check where in the script below is error?
Please refer that similar code using ssh-rsa 2048 hostkey was operated on other FTP server.
option echo on 
option batch abort
option confirm off
 
open ftp://ID:PW@sFPT server:22 -passive -explicitssl -explicittls  -implicit -hostkey="ssh-rsa 4096 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX="
get -filemask="*>=%TIMESTAMP#yyyy-mm-dd%"  "/sFTP folder/" "\local folder"
 
close
exit