[ACCEPTED]-ssh2_auth_pubkey_file authentication always fails-dsa
Accepted answer
The error in this case was that the keys 11 were generated by the root user, but they 10 need to be accessible by the web server 9 group/owner www-data
.
I didn't like the idea of keeping 8 ssh keys in a web folder open to www-data
, so I 7 moved the key files to a new user's home 6 directory (/home/keyuser/
) then made them accessible to 5 www-data
. Authentication was successful.
Even though 4 the original error was saying it found the 3 file, it couldn't read the file.
A better 2 debug method is to try reading the file 1 via php:
$prv_key = file_get_contents('/var/www/application/files/id_dsa');
print "<pre>";
var_export($prv_key);
print "</pre>";
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.