Capistrano doesn't know port number?


#1

This is a Capistrano question (sorry if those aren’t encouraged), but
am I understanding this wrong?

[removed_email_address@domain.invalid] executing command
** [out :: removed_email_address@domain.invalid] ssh: connect to host xxx.xx.xx.xxx
port 22: Connection refused
** [out :: removed_email_address@domain.invalid] svn: Connection closed unexpectedly

in my deploy.rb I have this:

ssh_options[:keys] = %w(/Users/base/.ssh/id_dsa)
ssh_options[:port] = 6666

which I assumed would tell Capistrano to use port 6666. It worked fine
through the other tasks that I used but this one doesn’t seem to get
it. This strikes me as pretty wierd. Any suggestions? I mean it seems
like this is something pretty fundamentally wrong on my part.


#2

Yeah, I’m in the midst of trying to get around this, but I would think
if this was a real problem (i.e. not implemented, vs just a
configuration problem) more people would have noticed it. I mean, not
being able to use any port other than 22 seems like it might be a kind
of large piece of missing functionality, or am I one of the few people
logging in from ports other than 22?


#3

joshuajnoble wrote:

ssh_options[:keys] = %w(/Users/base/.ssh/id_dsa)
ssh_options[:port] = 6666

which I assumed would tell Capistrano to use port 6666. It worked fine
through the other tasks that I used but this one doesn’t seem to get
it. This strikes me as pretty wierd. Any suggestions? I mean it seems
like this is something pretty fundamentally wrong on my part.

I remember struggling with something similar with Capistrano myself. I
remember trying the suggestions of adding the server info to the .config
file of my .ssh directory and the config file in my subversion
directory, but it still blew up during a deploy. I meant to file a bug
report with Jamis, but I got lazy.

I’m not in front of my linux box right now, so I can’t tell you exactly
what my work around was, but I remember it was kind of kludgy.

HTH,

Jamey C.


#4

I gave this a try to no avail

def self.connect(server, config, port=6666, &block)
methods = [ %w(publickey hostbased), %w(password keyboard-
interactive) ]
password_value = nil

 user, server_stripped, pport = parse_server(server)

 begin
   ssh_options = { :username => (user || config.user),
                   :password => password_value,
         #:port => ((pport && pport != port) ? pport : port),
            :port => 6666,
            :auth_methods => methods.shift 

}.merge(config.ssh_options)
Net::SSH.start(server_stripped,ssh_options,&block)
rescue Net::SSH::AuthenticationFailed
raise if methods.empty?
password_value = config.password
retry
end
end

But still no love, so I really don’t know where port 22 could be
getting defined. Do I have to change my access port in order to use
Capistrano?


#5

Thanks for the tip. I noticed that when I was looking at the ssh.rb
file. I ended up just changing my port.


#6

Josh-

If you have cap 1.4.1 installed then you can set the port for each
server in the role setting:

role :web, “65.76.159.124:6800”

Cap will just do the right thing then.

CHeers-
-Ezra

On Jun 5, 2007, at 11:23 AM, joshuajnoble wrote:

retry

if this was a real problem (i.e. not implemented, vs just a

This is a Capistrano question (sorry if those aren’t

exactly
what my work around was, but I remember it was kind of kludgy.

HTH,

Jamey C.

– Ezra Z.
– Lead Rails Evangelist
– removed_email_address@domain.invalid
– Engine Y., Serious Rails Hosting
– (866) 518-YARD (9273)


#7

Having same problems. If you find a cure other than changing port
number. Let me know.

Cheers
Zach I.
→ Blog – http://www.zachinglis.com
→ Company – http://www.lt3media.com
→ Portfolio – http://portfolio.zachinglis.com
→ Web Designer → Print Designer → Identity Desginer → Ruby on
Rails developer → et plus.
→ AIM: zachinglis → MSN: removed_email_address@domain.invalid → Others
available on request