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
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