in reply to How to establish SFTP connection to a server using a ppk file

Mostly responding because no one else has... PPK is a file format used by PuTTY (which Pageant is part of), and not really by any other software. The SSH (.pub) open standard is much more common, and supported by Net::SFTP. You can use PuTTYGen to export to the OpenSSH format, and use that instead.

  • Comment on Re: How to establish SFTP connection to a server using a ppk file

Replies are listed 'Best First'.
Re^2: How to establish SFTP connection to a server using a ppk file
by punitpawar (Sexton) on Jul 20, 2012 at 15:32 UTC
    HI Arnon, Thanks for the reply.So the ppk file which I am currently using to load via Pagent has the following content :
    PuTTY-User-Key-File-2: ssh-rsa Encryption: none Comment: imported-openssh-key Public-Lines: 4 AAAAB3NzaC1yc2EAAAABIwAAAIEAlZaCpbUY1cVpO3D8i74QA0PnlExO2hOpS+mh ...bl +a bla bla Private-Lines: 8 AAAAgDNJi+EK4/GFgypSn7riFB5gbKffpgGgV006KOcQnKv2d3G2mRUaT5zHkk08 ...bl +a bla bla Private-MAC: 21d2a17d1378533ce907f67ca647f217ab35c548
    So by just looking at the file I guess it includes the publi c and private key which it uses to connect to the SFTP server. I tried to export the OPen SSH format as you mentioned earlier via puttygen for this file and saved the file as "Identity" . But not sure if there is a need for me to load the same file twice and save it once as Private Key and then for Public key.....PLease correct me If I am wrong here...This is only because I have one file which I assume has public and private key both in it.....(coz th eppk file says "public lines ....Private lines" Also what would be the arguments that I would need to given in my hash (ssh_args) for identity files ? Do the Identity files point to the public or private key location folder ? Currently by default it generates a file known as "Known_hosts2" in my home directory... IF you could give me some guidance on this that would be great... Thanks again for your time and help !!

      This is stepping outside the realm of Perl now, and is more of an SSH question. Typically the client only needs one file - the private key / identity - which is installed locally, and would be referred to by your Net::SFTP call (in identity_files). The public key is installed on the server-side, which I assume is already done if you connected successfully via FileZilla.

      The known_hosts file is something else, not really related to this. You might want to spend a few minutes reading up about SSH to learn more.