WebApp Sec mailing list archives

Re: Server's host key & pscp.exe trouble


From: Jonathan Angliss <jon () netdork net>
Date: Sat, 6 Aug 2005 22:19:05 -0500

Hello Bénoni,

Thursday, August 4, 2005, 11:16:54 AM, you wrote:

I am getting dialy log files from a remote machine (web server) into
my local database. To do this, I wrote an SQL script using pscp.exe
to get the files, using the following command-line:

        C:\pscp.exe -batch -sftp -C -2 -v -pw *****
user_X@111.111.111.111:' + @my_remote_file + ' ' + @my_local_path

Whatever I do, I always have the following error message: "The
server's host key is not cached in the registry ... Connection
abandoned.". So I cannot get the file.

I did this operation manually through cmd to check my syntax, I was
asked whether to store the remote key or not (I agreed), and then my
file was transferred succesfully. I tried one again after this, and
I was not asked any more for caching the key. Great. But when I try
to start again my SQL script, the same trouble with the key
happends.

Maybe the solution would be to add manually the pscp's key in the
registry, anyone did this before ?

How about logging in as the user that is running SQL, and then
executing pscp once? I'm assuming you're using ms sql (you didn't
mention it), which has it's job agent running as a specified user (I
believe the default is a local system user, but you can define one
yourself). The issue is probably arising because /you/ have the key,
but the SQL account does not.

Hope that gives you a hint.

-- 
Jonathan
<jon () netdork net>

Attachment: _bin
Description:


Current thread: