Question

I'm trying to open multiple connections with ssh2_auth_pubkey_file to different servers using the same public & private keys.

When my script tries connecting to the 2nd server I get:

PHP Warning: ssh2_auth_pubkey_file(): Authentication failed for me using public key: Unable to open public key file

I'm guessing it can't have two open file pointers, but I don't see why not. Is there a way around this?

Was it helpful?

Solution

this probably would not be an issue with phpseclib. just do file_get_contents on the key and load that into a Crypt_RSA object which is then passed into the Net_SSH2 login method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top