Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

Sure, you can know it. The same way you've learnt the rest of the host key.
moshe.h

Re: Trouble with hostkey auto-confirmation

Anonymous wrote:

moshe.h wrote:

The hostkeys were identical.

...or not...I'm not prikryl, so I could be wrong, but I noticed this...

moshe.h wrote:

/hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

moshe.h wrote:

ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

...as far as I know host keys will not match if the bits are different, you specify 1024 bits & receive 2048 bits.

I also have no idea why it works in CMD & doesn't work the other way. Can you find out how many bits you are getting & is working in CMD? Does the server support both 1024 & 2048 bits?


GOOD EYE guest, I missed the difference.
BTW - running from the CMD worked because I have a few copies of WinSCP.com floating around and I used a different one :oops:

QUESTION: is there a way to know a-priori if an ftp server is ssh-rsa 1024 or ssh-rsa 2048?
Guest

Re: Trouble with hostkey auto-confirmation

moshe.h wrote:

The hostkeys were identical.

...or not...I'm not prikryl, so I could be wrong, but I noticed this...

moshe.h wrote:

/hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"

moshe.h wrote:

ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx

...as far as I know host keys will not match if the bits are different, you specify 1024 bits & receive 2048 bits.

I also have no idea why it works in CMD & doesn't work the other way. Can you find out how many bits you are getting & is working in CMD? Does the server support both 1024 & 2048 bits?
moshe.h

Trouble with hostkey auto-confirmation

I am running winscp.com from a .net2.0/C# System.Diagnostics.Process object.
I am using a privatekey file.

The following is a the argument string used when calling winSCP.com:
blah@blahblah.com
/privatekey="C:\tmp\blah.ppk"
/hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
/command
"option confirm off"
"cd ""/home/blah/moshe_temp/"""
"put ""c:\Dev\DotNet\Application\WinSCP.ini"""
"put ""c:\Dev\DotNet\Application\WinSCP.com"""
"put ""c:\tmp\stam.txt"""
"exit"


NOTE: I USED THE ABOVE STRING IN CMD AND IT WORKED JUST FINE.

In my c# program the process hanged - waiting for a hostkey confirmation. The hostkeys were identical. I killed the winscp.com process and looked at the output string:
Searching for host...
Connecting to host...
Authenticating...
The server's host key was not found in the cache. You have no guarantee that the server is the computer you think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
If you trust this host, press Yes. To connect without adding host key to the cache, press No. To abandon the connection press Cancel.
Continue connecting and add host key to the cache?
(Y)es, (N)o, C(a)ncel, (C)opy Key:


Please advise

Thank you
Moshe

PS
How do you chain multiple options?
option batch on
option confirm off


I did not find anything in the docs