Re: Hoping for a working example of SFTP in PHP

From: Date: Mon, 01 Feb 2021 20:27:09 +0000
Subject: Re: Hoping for a working example of SFTP in PHP
References: 1 2 3 4 5 6 7 8  Groups: php.general 
Request: Send a blank email to php-general+get-327437@lists.php.net to get a copy of this message
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@springtimesoftware.com> 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?

« previous php.general (#327437) next »