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

is there a way to manipulate the time before using fallback gateway? #101

Closed
Zhann opened this issue Jan 31, 2016 · 6 comments
Closed

is there a way to manipulate the time before using fallback gateway? #101

Zhann opened this issue Jan 31, 2016 · 6 comments
Assignees
Labels

Comments

@Zhann
Copy link

Zhann commented Jan 31, 2016

More a question than an issue ..

Love this tool btw.

Been playing with ConnectTimeout: 10 but that doesn't seem to work:

Connection timed out during banner exchange
@moul moul added the Question label Feb 1, 2016
@moul
Copy link
Owner

moul commented Feb 1, 2016

Hi @Zhann, thank you for your feedback,

Can you give me an (anonymised) example of configuration file ?

@moul
Copy link
Owner

moul commented Feb 1, 2016

Note that when you are setting the gateways field; assh will iterate over all the entries of this field until the the first successful connection.
So technically, the first host is not a fallback, but the second one, the third one... are

If you want to have "fallback gateways", you need to put the magic "direct" host as the first entry of this field, so assh will try to connect without gateways before trying the rest of the list.

Do you find that odd? I may write a note on the README.md if this is not 100% clear as it is for me the feature I'm using the most every days :)


example:

hosts:
  aaa:
    gateways:
    - bbb
    - ccc
    - direct
    - eee

ssh aaa will try until first success:

  • ssh bbb -> ssh aaa
  • ssh ccc -> ssh aaa
  • ssh aaa
  • ssh eee -> ssh aaa

@moul moul self-assigned this Feb 1, 2016
@moul
Copy link
Owner

moul commented Feb 3, 2016

I just released a new version here: https://github.com/moul/advanced-ssh-config/releases/tag/v2.2.0

Can you get the latest version and run these commands:

$ assh proxy --dry-run <your-host>
$ assh info

For example, here is mine:

$ assh proxy --dry-run test-ccc
ERRO[0000] Cannot use gateway '2.3.4.5': dry-run: Execute [ssh 2.3.4.5 -- nc 1.2.3.8 22]
ERRO[0000] Cannot use gateway '3.4.5.6': dry-run: Execute [ssh 3.4.5.6 -- nc 1.2.3.8 22]
ERRO[0000] Failed to use 'direct' connection: dry-run: Golang native TCP connection to '1.2.3.8:22'
ERRO[0000] Cannot use gateway '4.5.6.7': dry-run: Execute [ssh 4.5.6.7 -- nc 1.2.3.8 22]
FATA[0000] Proxy error: No such available gateway
$ assh info
Debug mode (client): false
CLI Path: /usr/local/bin/assh
Go version: go1.5.3
OS/Arch: darwin/amd64

RC files:
- ~/.ssh/assh.d/ocs.yml
- ~/.ssh/assh.d/pathwar.yml
- ~/.ssh/assh.d/test.yml
- ~/.ssh/assh.yml
- ~/.ssh/assh.d/esl.yml
- ~/.ssh/assh.d/hosts.yml
- ~/.ssh/assh.d/moul.yml

Statistics:
- 187 hosts
- 0 templates
- 7 included files

@moul
Copy link
Owner

moul commented Feb 18, 2016

Hi @Zhann, #116 should fix this issue, can you get the latest version and give a new try ?

@Zhann
Copy link
Author

Zhann commented Feb 19, 2016

Hi @moul, sorry for not replying earlier. Yes, this fixed my issue! Thank you very much.

@Zhann Zhann closed this as completed Feb 19, 2016
@moul
Copy link
Owner

moul commented Feb 19, 2016

super 👍

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

No branches or pull requests

2 participants