SSH keys in environment variables

So, I'm setting up a really awesome hubot setting, which automatically deploys the code from github to heroku through the free heroku nodejs app. I'm having trouble checking repo on AWS. I created SSH keys on the remote box, made them work and validate them. Then I added them to Heroku's environment variables as follows:

~$ heroku config:add PRIVATE_KEY="...
aoijsdfasoidjfasodijfasodifjaodsifjasdofija"

Then I try to repeat both the public and private keys back to their usual place in .ssh/id_rsa, but they ask me about a passphrase that I did not set, and always fails.

Any idea how to successfully write an environment variable key? I think this is due to the fact that the lines are not displayed correctly.

+5
source share
2

! .

echo "$VAR", . .

( . .)

+7

, :

heroku config:set PRIVATE_KEY="$(cat id_rsa)"
+1

All Articles