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

QUESTION: How to avoid ssh tunnel timing out? #202

Closed
lucharo opened this issue Oct 29, 2020 · 3 comments
Closed

QUESTION: How to avoid ssh tunnel timing out? #202

lucharo opened this issue Oct 29, 2020 · 3 comments
Labels

Comments

@lucharo
Copy link

lucharo commented Oct 29, 2020

Hello, I would like to know a couple of things:

  • What is the default timeout? How long does it take an ssh connection to stop using this package?
  • how can it be changed/extended?

I've read a few options in stack overflow and the pull request #156 but I am not confident SSH_TIMEOUT is what I am looking for, could you clarify my doubts?

@lucharo lucharo changed the title QUESTION: How avoid ssh tunnel timing out? QUESTION: How to avoid ssh tunnel timing out? Oct 29, 2020
@pahaz
Copy link
Owner

pahaz commented Oct 30, 2020

There are some cases:

  1. ssh client-side timeouts
  2. ssh server-side timeouts
  3. NAT timeout or some network proxy host timeouts

Currently, we don't have timeout options for the case1. We can add it as a new feature in future releases.

The case2 is configured on the server-side and depends on the ssh server.

You can prevent case 3 by using set_keepalive options. But there is no 100% guarantee that your network/router rules don't break long TCP connections.

We also have SSH_TIMEOUT as your say, but it's for socket.settimeout (docs) and yes, it's not what are you looking for.

@pahaz pahaz added the question label Oct 30, 2020
@lucharo
Copy link
Author

lucharo commented Oct 30, 2020

Thanks for the answer @pahaz. I think that along with the set_keepalive option in paramiko and this I am able to sustain a longer SSH session!

@lucharo lucharo closed this as completed Oct 30, 2020
@pahaz
Copy link
Owner

pahaz commented Oct 30, 2020 via email

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