Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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). inside.mines.edu/~gmurray/HowTo/sshNotes.html –  msw Jun 23 '10 at 14:55
add comment

2 Answers

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
2  
This is correct although the question is wrong. –  msw Jun 23 '10 at 14:52
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.