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

vichu

Re: How to sftp without storing any session

martin wrote:

You are not suppoed to get hostkey by the script. You should know the hostkey before and use it in the script.

Please read:
https://winscp.net/eng/docs/ssh[/quote]

Thanks Prikryl. I will save the session first and then use it thru my script.
martin

Re: How to sftp without storing any session

vichu wrote:

Thanks. I can able to get HostKey detail from PUTTYGen by importing the privatekey. I like to know how to get the hostkey information using Script.

You are not suppoed to get hostkey by the script. You should know the hostkey before and use it in the script.
Please read:
https://winscp.net/eng/docs/ssh
vichu

Re: How to sftp without storing any session

martin wrote:

Hostkey is not stored in the private key. Host key is public key of the server. Private key is not specific to the server.



Thanks. I can able to get HostKey detail from PUTTYGen by importing the privatekey. I like to know how to get the hostkey information using Script.
martin

Re: How to sftp without storing any session

Hostkey is not stored in the private key. Host key is public key of the server. Private key is not specific to the server.
vichu

Re: How to sftp without storing any session

Thanks for your reply.

I am able to connect with -hostkey option. I like to know how to get the -hostkey information from privatekey using winscp command or script.
vichu

How to sftp without storing any session

I try to connect to sftp thru command line interface. when connecting first time it ask me Do you want to add the host key to cache? (Yes,No,Cancel,Copy Key).
How to force the script to always select "No" option.

My script is

winscp.com /console /command "option batch on" "option confirm off" "open user:pwd@myServer -privatekey=""C:\temp\myprivateKey.ppk""" "cd Upload" "put My SFTPTest.txt" "exit" /log="C:\temp\Winscp.log"


Thanks in advance