I need to connect to some Amazon EC2 instances through php’s ssh2 functions to get some info and display it on my backoffice.
Is there a way in ssh2 functions to do the same I do when connecting through the command line ssh?
ssh -i path_to_file/key.pem host01-ec2
Thanks
You can use
openssl_pkey_get_publicto extract the pub/private keys, and then usessh2_auth_pubkey_fileto authorize.