Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I received from a partner an SSH private key also, I need to make a php script to connect to the host and send some data through this connexion.

However I need to provide to the ssh php function a public key, but the partner didn't send me the public key.

How can I get from the remote host the public key in a separate file?

Any advices?

share|improve this question
If you are connecting from an application to a remote host, you need access to the private key to authenticate to the remote host, the public key will not help you authenticate (if it did, and was public, then anyone could authenticate to the host). – msw Jun 23 '10 at 14:55

If you have the private key you can generate the public key from it using ssh-keygen -i, unless I am mistaken.

share|improve this answer
This is correct although the question is wrong. – msw Jun 23 '10 at 14:52

Is this a key for a specific user? If so, and you have access to the server, it would be something like ~/.ssh/

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .