Re: Hoping for a working example of SFTP in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David,

It seems like a file permission error when the web user tries to access outside of the web root. Usually the web user can’t read outside of the webroot for security. Can you move the RSA into the same working folder as your code and try again?

Thanks,

Bastien Koert

> On Feb 1, 2021, at 3:24 PM, David Spector <david025@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
> I found a discussion of changing the format of the public key at https://blog.oddbit.com/post/2011-05-08-converting-openssh-public-keys/.
> 
> So I used
> 
> ssh-keygen -f w.pub -e -m pem
> 
> to get a "BEGIN RSA PUBLIC KEY" file from the "ssh-rsa" file.
> 
> My program still fails with the same error message.
> 
> I also tried reading the key files into strings:
> 
> $wpub=file_get_contents("w.pub");
> $wkey=file_get_contents("w.key");
> if (ssh2_auth_pubkey_file($connection, $user, $wpub, $wkey, $passphrase)) {
> 
> And this, too, failed with the same error message.
> 
> Why can't ssh2_auth_pubkey_file give more details in its error message?
> 
> I'm again running out of free time. Any experts out there?




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux