Topic "script did not read the private key file"

Author Message
Hanna

Guest


Hi Martin,

I have tried a script and passed the private key in /privatekey.

winscp3.exe /console scp://xxx@ftp.xxx.org:xx /privatekey=privatekey.ppk /script=myscript.txt /log=myscript.log

The script works perfectly through the scheduled task on my own computer. However, when we tried to run the script on our cluster ftp server, the script runs but it does not read the private key file. Below is the log message that did not read the key file. Could you please help to figure why the difference?


WinSCP Version 3.8.1 (Build 328) (OS 5.0.2195 Service Pack 4)
Login time: Monday, June 12, 2006 5:45:00 AM
--------------------------------------------------------------.
Session name: xxx@ftp.xxx.org
Host name: ftp.xxx.org (Port: xx)
User name: xxx (Password: No, Key file: No)
Transfer Protocol: SCP
SSH protocol version: 2; Compression: No
Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
Ciphers: aes,blowfish,3des,WARN,des; Ssh2DES: No
Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
SSH Bugs: -,-,-,-,-,-,-,-
SFTP Bugs: -,-,-
Proxy: none
Return code variable: Autodetect; Lookup user groups: Yes
Shell: default, EOL: 0
Local directory: default, Remote directory: home, Update: No, Cache: Yes
Cache directory changes: Yes, Permanent: Yes
Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
Alias LS: No, Ign LS warn: Yes, Scp1 Comp: No
--------------------------------------------------------------------------
Looking up host "ftp.xxx.org"
Connecting to xxx.xxx.xxx.xx port xx
Server version: SSH-2.0-Sun_SSH_1.0.1
We believe remote version has SSH-2 rekey bug
We claim version: SSH-2.0-WinSCP_release_3.8.1
Using SSH protocol version 2
Using Diffie-Hellman with standard group "group1"
Doing Diffie-Hellman key exchange
Asking user:
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: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? ()


Thank you in advance!!!

Hanna
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24552
Location: Prague, Czechia
It does not get that far to read the private key. Please read documentation.
_________________
Martin Prikryl
Guest




This is the difference I found on the key reading --
1. One my own computer, the log message is like this --
. Host key fingerprint is:
. ssh-rsa xxxx xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
. Initialised AES-128 client->server encryption
. Initialised HMAC-SHA1 client->server MAC algorithm
. Initialised AES-128 server->client encryption
. Initialised HMAC-SHA1 server->client MAC algorithm
! Using username "xxxxxx".
. Reading private key file "privatekey.ppk"
. Offered public key
. Offer of public key accepted
! Authenticating with public key "dsa-key-20060523".
. Access granted
. Opened channel for session
. Started a shell/command

2. On the cluster server, the log message is like this --
. Using Diffie-Hellman with standard group "group1"
. Doing Diffie-Hellman key exchange
. Asking user:
. 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: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? ()
---END of Log---

ALSO: The script ran succseefully by manually double click the batch file. But it failed and did not read key file if ran the batch file from a Windows Scheduled Task.

Any idea? Confused Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24552
Location: Prague, Czechia
Have you read the documentation? Or at least the FAQ?
_________________
Martin Prikryl
Hanna

Guest


Thanks and yes the FAQ is very helpful Very Happy
We copied the ini file over to the server and the problem is resolved!

Thanks again for helping!

Hanna
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