I am having trouble connecting to an SFTP server using a .ppk file that are provided.
I have tried this ppk file in Filezilla and it works. According to one of the comments in another question it is better to use phpseclib but i didnt find any instructions on how to download files from SFTP using a ppk file. Any directions or suggestions?
Here is the code I'm not sure if that will help or not.
include('Net/SSH2.php');
include('Crypt/RSA.php');
include('Net/SFTP.php');
DEFINE('SERVER','sample.sftp.com');
DEFINE('USER','sampleUserName');
DEFINE('KEY','sample_key_22733_priv.ppk');
$sftp = new Net_SFTP(SERVER);
//I guess this password is useless here
//and i will have to use my ppk file here but i don't know how
if (!$sftp->login(USER, 'password')) {
exit('Login Failed');
}
var_dump($sftp->nlist());