- Evan at Sumitomo
There is an example in documentation of open command. Basically you need to enclose the host key to quotes.I'm having the same issue. When you do your next documentation additions, can you provide examples of how the switches and options should be used? Thanks! I've tried to put the auto accept of the host key in many places using a script file with no succes so I decided to go to my command line. Here's my command
open sftp:user:firstname.lastname@example.org /hostkey=ssh-rsa 1024 46:62:9d:86:45:d0:b9:b2:b4:0f:61:a2:af:40:8a:ea
When I execute this I receive a "too many parameters for command 'open'" error.
Why do you need that?However, I noticed that even though I'm specifying the host key, it doesn't store the fingerprint in the registry. Is there another option to store that?
That does not make any sense. So either you are doing automatic script that has to run with default configuration (on any machine), without making any changes to it. Than you use -hostkey. Or you want to cache the hostkey for regular (non-automatic) use. Than you can do it from GUI or by importing the settings to registry (you can do it automatically as well). You are mixing two different things together.So that the next time I want to send to that address I don't have to specify the host key.
OK, that's something you absolutely should not do. You break all security in SSH by this. Of course do whatever you want to do. But do not ask me to implement support for it.Yes I am but I want to do it in scripting. After I have a transfer failure, because it's a new site and I haven't accepted the host key, I want to be able to run my process which will pull the host key from the log, connect to the site, automatically accepting the key that I've supplied, and storing what it needs in the registry for future scripting use.
But WinSCP allows that. Just not the way you are trying to do it.Okay so forget that I said the scripting part but asking for it to save the information in the registry, in my opinion, is a valid request that other people may like to see. If I've entered the key once for a site, why should I have to continue to enter it? I've already validated that I know the key and it matches the site I'm connecting to, which I believe maintains the security. I just want to store it for future connections to that site.
I suppose that the space in "/script= scp.txt" is the problem. This way, WinSCP does not connect "/script=" with "scp.txt". It ignores empty script switch and tries to connect to host "scp.txt".i call this command in my program :
lanceAppli("winscp.com /script= scp.txt")
in my scp.txt i put :
That does not make any sense. So either you are doing automatic script that has to run with default configuration (on any machine), without making any changes to it. Than you use -hostkey. Or you want to cache the hostkey for regular (non-automatic) use. Than you can do it from GUI or by importing the settings to registry)
Such error does not exist in WinSCP. Maybe you mean log record "Host key does not match cached key..."Just want to ask a question ,If we have both , one key mentioned in the registry and other one in open command with -hostkey , will it produce any error .
In my case i have the one hostkey fingerprint hardcoded in the script while the other one present in the registry . Both are different . I want my script to execute successfully , I dont know about the one stored in registry but it gives the error "host key not found in the cache "
-hostkey. If you get different results, please start a new topic and attach a complete session log file.
You can post new topics in this forum