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'm basically trying to do this using openssh:

I have a private key, however it isn't in file (it's in memory). Now, I want to create the public key in openssh format. For that I would generally run ssh-keygen -y -f <filename>. However I do not have a file name, since i don't have a file. I'd like to feed openssh from the standard input somehow instead. How would I do that?

If it isn't possible I wouldn't mind having openssh generate both private and public keys BUT I can't write them to a file. Instead I would like to write them both to stdout. How can I achieve this?

share|improve this question
1  
Could you explain your aversion to files? What exactly are you trying to do here? Why can't you use files? –  terdon Jun 23 '13 at 13:05
    
I am doing this as an automated task from a java server. I could write a file to the filesystem, run ssh-keygen on it and then delete it. However, this is an unnecessary overhead. I would like to just give the private key from stdin and redirect the output to stdout. the ssh-keygen utility does not seem to allow me to do this although to me this seems very basic –  ShinySpiderdude Jun 23 '13 at 14:35
    
Perhaps this StackOverflow question might help? –  Calrion Oct 17 '13 at 1:37

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.