Skip to main content
The 2024 Developer Survey results are live! See the results

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 1
    Why in lords name do you want to be able to file_get_contents() a private ssh key? This reeks of your-doing-it-wrong... Seriously, what purpose do you have reading in the private key that you need it available for both?
    – ircmaxell
    Commented Aug 27, 2013 at 16:34
  • I guess he wants to retrieve a file via ssh/scp and PHP has some way to specify a private key to use for this. Anyway, I agree that this is a horrible idea. Commented Aug 27, 2013 at 16:38
  • Updated with clarification. I'm creating an SSH connection within PHP, and this requires a private key. It's (I assume) a valid purpose, hence why I asked for a solution that maintains good security (if there is one) :)
    – James
    Commented Aug 27, 2013 at 16:43
  • Then create a new, separate private key... Don't re-use keys for multiple purposes...
    – ircmaxell
    Commented Aug 27, 2013 at 16:44