host key in batch

Advertisement

MTecknology
Joined:
Posts:
2

host key in batch

I understand that the host key is important to the security of ssh. However it is causing me many problems. I have logged in with the GUI and accepted the key. When I try to run my script, I get an error in the log saying the host key wasn't verified.

I NEED a way to run this without any verification.

I work in at a school with about 5-600 machines. I have a file server specifically set up to backup a users data. On a USB drive I have a batch file that executes this command. -> winscp403.exe /console /ini=C:\WINDOWS\Temp\winscp382.ini /script=winscpscript.txt

------This is the end of the log file it created------
. 2007-07-19 13:50:59.874 If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
. 2007-07-19 13:50:59.874
. 2007-07-19 13:50:59.874 Continue connecting and add host key to the cache? ()
. 2007-07-19 13:50:59.890 Attempt to close connection due to fatal exception:
* 2007-07-19 13:50:59.890 Host key wasn't verified!
. 2007-07-19 13:50:59.890 Closing connection.


The idea is to be able to backup the persons data with minimal effort. (Just plug in a USB drive and double click the batch file.

Going around and tweaking every system in all three buildings would be a major pain in the ass so I either need a way around this issue or I'm going to need an alternative to WinSCP...

Any ideas on how to force it to confirm with(Y) every time it asks me someting?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: host key in batch

If you accept the key (either in GUI or script) while using an INI file, the key gets stored into the INI file. So then, whereever you run your script with the INI file, the key is known already.
_________________
Martin Prikryl

Reply with quote

MTecknology
Joined:
Posts:
2

It doesn't appear to work fully... I have it stored in the ini file but I believe I found the registry key where the other piece is stored. It won't be a big deal to merge a .reg file b4 running the batch so I think that's a good enough solution. I'll mess around with it more to find the most ideal solution since I'm always doing that though.

Thanks

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

MTecknology wrote:

It doesn't appear to work fully... I have it stored in the ini file but I believe I found the registry key where the other piece is stored.
That's not how it works. You may have in both places, but the place that's actually used matters only.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum