1

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?

mpen
  • 272,448
  • 266
  • 850
  • 1,236

1 Answers1

2

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.

danarys
  • 36
  • 1