Skip to content
This repository has been archived by the owner on Jun 10, 2018. It is now read-only.

How can I set ssh port? #28

Open
wkojiro opened this issue Jan 5, 2017 · 5 comments
Open

How can I set ssh port? #28

wkojiro opened this issue Jan 5, 2017 · 5 comments

Comments

@wkojiro
Copy link

wkojiro commented Jan 5, 2017

Thank you for wonderful gem !
When I do "cap production rails:console" I get:
"ssh: connect to host XXXXX port 22: Connection timed out"

I am not using default port 22 of course, I set port number in my deploy/production.rb and deploy works well.
How and where should I put port number for this gem?

@ydkn
Copy link
Owner

ydkn commented Jan 8, 2017

How do you set the port in deploy/production.rb?

@matthutchinson
Copy link

matthutchinson commented Apr 3, 2017

Fails for me too, i've set the port like this in deploy/production.rb

set :ssh_options, { forward_agent: true, port: 39456, user: 'username' }

regular cap deploys work fine, this task does not

@augustosamame
Copy link

+1

I set the port in deploy/production.rb as:

  set :ssh_options, {
    keys: %w(/Users/Augusto/Documents/Credentials/mykey.pem),
    port: 1222
  }

regular cap also works fine

@augustosamame
Copy link

Aha!
Fixed it like this:

In the single server settings in the deploy/production.rb file:


server 'xx.xx.xx.xx', user: 'deploy', roles: %w{web app db},
  ssh_options: { keys: %w(/Users/Augusto/Documents/Credentials/mykey.pem),
                 port: 1222
               }

Now the gem connects on the correct SSH port

@ydkn
Copy link
Owner

ydkn commented May 1, 2017

Hi @matthutchinson, @augustosamame
thanks for your feedback.

This issue should be fixed with sshkit-interactive v0.2.1 (afeld/sshkit-interactive@8491bcf). Please check if it works as expected after a bundle update.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants