using non-standard port with capistrano and git

1,265 views
Skip to first unread message

ohlhaver

unread,
Oct 9, 2008, 4:01:36 PM10/9/08
to Capistrano
Hi,

I am trying to deploy to my production server using a non-standard
port, such as 1234 . (Using capistrano, git and github as repo.)

Everything worked perfectly when I used port 22.

I updated the deploy.rb as follows:
ssh_options[:port] = 1234

But now I am getting this error:

'ssh: connect to host github.com port 1234: Connection refused'

The system assumes that I want to connect to the repo at that port,
which I don't. It's the port for my production server. The repo
settings should not be changed! Whatever I try I can't work around
this. This puzzles me since I assume that quite a lot of people would
use the github capistrano , non-standard port combination but didn't
find anything on Google.

Thus:
How do I set the deploy.rb correctly? Or do I need to change something
else?
It worked fine when I used standard port 22.
Thanks,
Justus

Lee Hambley

unread,
Oct 9, 2008, 5:20:53 PM10/9/08
to Capistrano
Hi Justus,

There probably is a way to do this in your capistrano configuration
- but I can vouch for Net::SSH honoring your port settings from your
ssh client configuration file.

Todo:

1. Edit ~/.ssh/config

2. Add something like this:

Host my.host.com
Port 2222

3. Ensure that it loads, by testing something like "ssh
my.host.com" (omit the port) and ensure that it connects properly..

4. Try capistrano again.

5. Come and let us know how that worked out for you :)

-- Further reading about SSH client config here in the man page (or,
of course through man) -- http://linux.die.net/man/5/ssh_config

-- Lee Hambley

justus ohlhaver

unread,
Oct 9, 2008, 6:02:14 PM10/9/08
to capis...@googlegroups.com
Hi Lee, Thanks a lot for your help. This was resolved by setting the default port to 22 in  /etc/ssh/ssh_config on the prod server.
Thanks again and good night,
Justus
Reply all
Reply to author
Forward
0 new messages