Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Net SSH2 auth_publickey not working in Windows

by taiko (Sexton)
on Feb 29, 2016 at 11:32 UTC ( #1156434=note: print w/replies, xml ) Need Help??

in reply to Net SSH2 auth_publickey not working in Windows

I experienced exactly same problem. How I resolved it is following.

1. Generated SSH-2DSA and dsa.ppk with puttygen on Windows

2. Converted dsa.ppk to openssh.ppk ( Conversion-> Export OPENSSH key) in puttygen

3. Loaded openssh.ppk and saved from Key window in puttygen

4. copied content to authorised_keys on server and on local windows computer

5. Voila

my $ssh2 = Net::SSH2->new(trace => -1); #$ssh2->debug(1); $ssh2->connect('server_ip') or die $!; print $ssh2->error; $ssh2->auth_publickey('username','','openssh.ppk') or die + "$!\n"; my $chan = $ssh2->channel(); $chan->blocking(0); $chan->exec('ls -al'); my @output; while (<$chan>) { print $_; }
works with no problems

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1156434]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2018-07-20 07:36 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (426 votes). Check out past polls.