Topic "How to accept adding the key to the cache ?"

Author Message
eniosp

Guest


Hi,

I am using the version 4.2.7 on Windows XP SP3.

I am try to run the following command.

Code:
"C:\Program Files\WinSCP\winscp.com" usr:pass@server /hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" /console /command "Option batch abort" "cd /home/internal/test" "Put -delete ""c:\temp\File1.pdf""" "Put -delete ""c:\temp\File1.csv""" "Put -delete ""c:\temp\File1.rdy""" "close" "exit"


I have the following output:

Quote:
C:\>"C:\Program Files\WinSCP\winscp.com" usr:pass@server /hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" /console /command "Option batch abort" "cd /home/internal/test" "Put -delete ""c:\temp\File1.pdf""" "Put -delete ""c:\temp\File1.csv""" "Put -delete ""c:\temp\File1.rdy""" "close" "exit"
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 dss key fingerprint is:
ssh-dss 1024 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 cac
he, 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:


Is there a way to automatically accept it ?

I've tried the option bellow. But instead of continuing Cancel is chosen.

Quote:
C:\>"C:\Program Files\WinSCP\winscp.com" /console /command "Option batch continue" "open sftp://usr:pass@server -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "cd /home/internal/test" "Put -delete ""c:\temp\File1.pdf""" "Put -delete ""c:\temp\File1.csv""" "Put -delete ""c:\temp\File1.rdy""" "close" "exit"
batch continue
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 dss key fingerprint is:
ssh-dss 1024 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 cac
he, 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: Cancel
Host key wasn't verified!
Authentication failed.
No session.
No session.
No session.
No session.
No session.


Many thanks
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Please read documentation. If that does not help, come back.
_________________
Martin Prikryl
eniosp

Guest


prikryl wrote:
Please read documentation. If that does not help, come back.


I've checked the documents but I could not make it work.

I've new tests now but I did not work:
Without batch option:
Code:
C:\>"C:\Program Files\WinSCP\winscp.com" /console /command "open sftp://usr:pass@host -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "close" "exit"
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 dss key fingerprint is:
ssh-dss 1024 eb:0d:68:30:8c:ef:2c:15:4d:b4:36:e1:51:e6:8b:fe
If you trust this host, press Yes. To connect without adding host key to the cac
he, 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:

With batch option continue:
Code:
C:\>"C:\Program Files\WinSCP\winscp.com" /console /command "Option batch continu
e" "open sftp://usr:pass@host -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx""" "close" "exit"
batch           continue
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 dss key fingerprint is:
ssh-dss 1024 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 cac
he, 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: Cancel
Host key wasn't verified!
Authentication failed.
No session.

C:\>


Many thanks,
Enio
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
You need to put real key fingerprint into hostkey switch.
eniosp

Guest


prikryl wrote:
You need to put real key fingerprint into hostkey switch.

Hi prikryl,

I've put it it was replaced by xx.xx. I can send you the logs without "masking".
eniosp
[View user's profile]

Joined: 2010-08-11
Posts: 1
Location: Zurich
eniosp wrote:
prikryl wrote:
You need to put real key fingerprint into hostkey switch.

Hi prikryl,

I've put it it was replaced by xx.xx. I can send you the logs without "masking".


I just send an email with complete log.
eniosp2

Guest


There is no issue here. Only the fingerprint did change.

I did not pay attention on the fingerprint value and thought there was an issue.

Thanks for the support.

Cheers,
dangfitz

Guest


I'm getting the key has changed message. I tried -hostkey & -certificate, but I keep getting the error, "too many parameters for command 'open'."

option batch on
option confirm off
open userid:passwd@server -hostkey="ssh-rsa 1024 xx:xx:xx..."
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Make sure you are using the latest version.
_________________
Martin Prikryl
Dhirendra

Guest


prikryl wrote:
Make sure you are using the latest version.

Hi.

I am able to connect it using the C# code with private key authentication. But when I execute this via window service it giving the same error. What do we do now? Please help me, my peers are asking "why did you use this tool?". What should I pass while opening the connection.

I am using 4.3.2 version....

Thanks in advace...
Dhirendra Misra
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
Dhirendra wrote:
I am able to connect it using the C# code with private key authentication. But when I execute this via window service it giving the same error.

Please read FAQ:
http://winscp.net/eng/docs/faq_scheduler
_________________
Martin Prikryl
ETLEngineer

Guest


I had the same problem; if you're using SQL Server Agent to execute your job\script and receiving the following message. You must logon to the server remotely with the userid:ServerAminID and execute WinScp software, login to the ftp site, wait for prompt requesting to cache the host key; once the key is accepted you can execute thru SQL Server Agent

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? ()
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
ETLEngineer wrote:
I had the same problem; if you're using SQL Server Agent to execute your job\script and receiving the following message. You must logon to the server remotely with the userid:ServerAminID and execute WinScp software, login to the ftp site, wait for prompt requesting to cache the host key; once the key is accepted you can execute thru SQL Server Agent

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? ()

Correct approach would be to use -hostkey switch of open command:
http://winscp.net/eng/docs/scriptcommand_open
LalitKukreja

Guest


Hi All,

The automated script is working in 6 out of 10 runs. Below are the messages that are received in success and failure scenarios.

================================================================
Success Message:
Executed as user: AccountName\UserID C:\Windows\system32>echo offbatch abort confirm off Searching for host...Connecting to host...Authenticating...Using username "UserID". Authenticating with pre-entered password.Authenticated. Starting the session...Reading remote directory...Session started. Active session: Other details
================================================================

Now the failure message:

Message
Executed as user: AccountName\UserID. C:\Windows\system32>echo offbatch abort confirm off 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 XXXX 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: Cancel Host key wasn't verified! Host key fingerprint is ssh-rsa XXXX xx:xx:xx:xx:xx:xx:xx:xx:xx:xx Authentication failed.

Any help on this please?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
LalitKukreja wrote:
The automated script is working in 6 out of 10 runs. Below are the messages that are received in success and failure scenarios.

Duplicate post:
http://winscp.net/forum/viewtopic.php?t=14602
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License