Using SSH Public Key Authentication with PHP
I'm developing a website with PHP where I want the web server to pass information via SSH to a separate jobs server to process.
Now I'm pretty sure what I want here is to use public keys so that the servers can talk without needing to password authenticate every time.
What I'm having a hard time figuring out is how to generate the SSH keys initially. The PHP pages are executed by a non-login user, wwwrun, which also obviously doesn't have a .ssh directory to store the key in.
What is the best way for me to do this? Do I need to use a bunch of exec() statements to create the key and pass it a blank passphrase when it asks for one? Where can I store it?
The web server does not have the PECL SSH2 extension installed, if that makes a difference.
Thanks for any help.