I am trying to do ha file transfer in Win32 environment using sftp and
private/public keys.
When using user and password authentication it works fine but if I use my
private key it stops and print "Loading private key failed."
If I use WinSCP or Putty and my private key it works fine.
---------code----------
my $sftp = Net::SFTP->new("my.host", ( user => "XXXXXX", password => "",
debug => 1,
ssh_args => ( ( [ identity_files => ([ "c:/test-RSA-Private.ppk" ])
] ) )
) );
---------------------------
fgth: Reading configuration data /.ssh/config
fgth: Reading configuration data /etc/ssh_config
fgth: Connecting to my.host, port 22.
fgth: Socket created, turning on blocking...
fgth: Remote protocol version 2.0, remote software version 3.2.3 F-Secure
SSH Windows NT Server
fgth: Net::SSH::Perl Version 1.25, protocol version 2.0.
fgth: No compat match: 3.2.3 F-Secure SSH Windows NT Server
fgth: Connection established.
fgth: Sent key-exchange init (KEXINIT), wait response.
fgth: Algorithms, c->s: 3des-cbc hmac-sha1 none
fgth: Algorithms, s->c: 3des-cbc hmac-sha1 none
fgth: Entering Diffie-Hellman Group 1 key exchange.
fgth: Sent DH public key, waiting for reply.
fgth: Received host key, type 'ssh-dss'.
fgth: Host 'my.host' is known and matches the host key.
fgth: Computing shared secret key.
fgth: Verifying server signature.
fgth: Waiting for NEWKEYS message.
fgth: Enabling incoming encryption/MAC/compression.
fgth: Send NEWKEYS, enable outgoing encryption/MAC/compression.
fgth: Sending request for user-authentication service.
fgth: Service accepted: ssh-userauth.
fgth: Trying empty user-authentication request.
fgth: Authentication methods that can continue: publickey.
fgth: Next method to try is publickey.
fgth: Trying pubkey authentication with key file 'c:/test-RSA-Private.ppk'
fgth: Will not query passphrase for 'c:/test-RSA-Private.ppk' in batch mode.
fgth: Loading private key failed.
Permission denied at C:/Perl/lib/Net/SFTP.pm line 37
Any one having a clue regarding this problem.
/Ulf
--------------------------------------------------
Do not be struck by others.
Do not strike others.
The principle is the peace without incident.
Mr. Chojun Miyagi
--------------------------------------------------
|