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

set -g tmate-server-port "xxxx" doesn't when there is a port defined in ~/.ssh/config #167

Open
glennie opened this issue Oct 24, 2019 · 2 comments · May be fixed by #186
Open

set -g tmate-server-port "xxxx" doesn't when there is a port defined in ~/.ssh/config #167

glennie opened this issue Oct 24, 2019 · 2 comments · May be fixed by #186

Comments

@glennie
Copy link

glennie commented Oct 24, 2019

Hello,
In my ssh configuration file, I've
Host *
Port 22
In this case, tmate tries to connect to port 22 even with set -g tmate-server-port "xxxx" in .tmate.conf.

IMHO, either tmate should ignore local ssh config or should be able to use a specific ssh configuration block.
Kinds regards,

@aebm
Copy link

aebm commented Dec 21, 2019

Hi, I have check this and the problem is because libssh v9 parses ssh config when you call ssh_connect and this overwrites the port set here

This is warned here

Parse the ssh config file.

This should be the last call of all options, it may overwrite options which are already set. It requires that the host name is already set with ssh_options_set_host().

aebm added a commit to aebm/tmate that referenced this issue Feb 19, 2020
* Since libssh 0.9 doing ssh_connect will call parse_config
  (unless it is deactivated SSH_OPTIONS_PROCESS_CONFIG)
  if ~/.ssh/config hasn't been parsed, overwriting the port option.
  So this will call parse_first before setting the port with
  tmate-server-port as commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b.

  Fixes tmate-io#167

  Commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b in libssh

  As the configuration parsing is the last thing before doing the
  actual connection, it might overwrite previously set options.
  If this is not intended, the client application can
  ask the configuration files to be parsed before setting some other
  options that should not ve overwritten.
@aebm aebm linked a pull request Feb 19, 2020 that will close this issue
@Val
Copy link

Val commented Nov 5, 2021

WTF, I've wasted half an hour because of this issue.

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

Successfully merging a pull request may close this issue.

3 participants