I'm trying to create a script with uses public/private keys. I have successfully generated and connected to the remote machine using the keys using the following instructions.
However, I would like to automate this process in a php script. How would I go about doing this?
In a shell I start ssh-agent2 with:
exec ssh-agent2
then proceed to add my passphrase with:
ssh-add2 /path/to/and/private_key_name
at this point I'm asked for my passphrase which I enter and then I can finally use,
ssh2 -l user_name remote.machine.name comand
How do I automate this in a php script? Any help would be greatly appreciated. Thank you for your time in reading this.