Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to specify custom port for SSH connections #197

Open
darthdeus opened this issue Feb 1, 2017 · 3 comments
Open

Ability to specify custom port for SSH connections #197

darthdeus opened this issue Feb 1, 2017 · 3 comments
Labels
enhancement an enhancement, not a bug

Comments

@darthdeus
Copy link

I've looked around quite a bit, but haven't found a way to configure edeliver to deploy to a server which doesn't run SSH on port 22.

I'm using edeliver v1.4.0 on Elixir 1.4.0

Current behavior

mix edeliver update fails with ssh: connect to host XXX port 22: Connection refused

Expected behavior

Have the ability to specify an SSH port in the edeliver config.

@onelesd
Copy link

onelesd commented Feb 2, 2017

I would like to see this in .deliver/config as well. I currently achieve this through ~/.ssh/config:

Host build.host.com
  Port 4242
Host prod.host.com
  Port 4242

@dabit
Copy link

dabit commented Mar 2, 2017

This

@lessless lessless added the enhancement an enhancement, not a bug label Feb 4, 2018
@norbu09
Copy link

norbu09 commented May 21, 2022

i just spent a few hours on this one. the problem is:

to get it half-way there set the following in .ssh/config

Host [build_host]
    port [custom_port]

it then fails with this error:

      [ -f ~/.profile ] && source ~/.profile
      set -e
      if [[ $(ssh-keygen -F "timeets.com" | grep -c found) = 0 ]]; then
        echo "Authorizing timeets.com on timeets@timeets.com:" &> /dev/null
        ssh-keyscan "timeets.com" 2>/dev/null &> /dev/null
        ssh-keyscan "timeets.com" 2>/dev/null >> ~/.ssh/known_hosts
      fi

which lead me down several rabbit holes. long story short ssh-keygen -F doesn't work with custom ports but can be made work by manually adding a fake entry. just copy the existing working entry for your host which is in the format:

[host]:port key_type key

and add an additional line with

host key_type key

this made everything work for me on a custom port. it would be amazing to get it working without these hacks or at least add the hacks to the docs :)

further reading:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement, not a bug
Projects
None yet
Development

No branches or pull requests

5 participants