I am using ssh2_connect() in PHP to move files from one server to another. However for the time being there are not two servers and I am just connecting the server to itself.
This is setup so that when there are two servers only the connection information needs changing rather than converting everything to ssh2 from the standard PHP functions.
This has worked for a while using password authentication but I am now switching over to Public Key authorisation.
I get the following error when trying to connect:
Username/PublicKey combination invalid
I've setup up the key a couple of times and the same thing happens. I am now wondering if it is not possible to authenticate this way on the same machine?
I know everything else is working with ssh because I have accessed the server with a public key from another server for another purpose.