I am unable to use the default port 22 and so have run into difficulties setting up git and heroku according to the hartl rails tutorial.
I was able to push to git by including the following in the ~/.ssh/config file:
Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
However, a similar entry does not work for heroku:
Host heroku.com
User git
Hostname ssh.heroku.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
It seems to hang at this debug line:
debug1: identity file /c/Users/[my folder name]/.ssh/id_rsa type 1
...before failing with this message:
ssh_exchange_identification: Connection closed by remote host.
I had hopes for this answer, Error in git push heroku master through ssh behind proxy it doesn't work for me either...
Any advice would be welcome.
Heroku is working on providing alternative ways to move source code onto the platform, take a look at heroku push
, for example: https://github.com/ddollar/heroku-push
It uses https and is thus not susceptible to the firewall-blocking you're experiencing.
UPDATE
Heroku now has beta HTTP Git support. If the problem is caused by you being unable to access Heroku on port 22, then HTTP Git should solve it (it works on port 443).
To use HTTP Git, first make sure Toolbelt is updated and that your credentials are current:
$ heroku update
$ heroku login
(this is important because Heroku HTTP Git authenticates in a slightly different way than the rest of Toolbelt)
During the beta, you get HTTP by passing the --http-git
flag to the relevant heroku apps:create
, heroku git:clone
and heroku git:remote
commands. To create a new app and have it be configured with a HTTP Git remote, run this:
$ heroku apps:create --http-git
To change an existing app from SSH to HTTP Git, simply run this command from the app’s directory on your machine:
$ heroku git:remote --http-git
Git remote heroku updated
Check out the Dev Center documentation for details on how set up HTTP Git for Heroku.
Wow. I'm impressed that github had the foresight to run ssh on 443. It's likely that heroku is just running https, which obviously wouldn't allow you to establish an ssh connection to git over.
Since github is working for you, why not leverage that? Use a service like travisci to watch github, build, and deploy to heroku.
A simple example using travis: http://metabates.com/2012/10/23/deploying-to-heroku-from-travisci/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With