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

ssh: ssh keep alive #9125

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandrejbr
Copy link

This PR aims at introducing the equivalent of openssh ClientAliveInterval/ClientAliveCountMax (https://man.openbsd.org/sshd_config#ClientAliveCountMax) and ServerAliveInterval/ServerAliveCountMax

There's 2 notable differences:

  1. In openssh "The default is 0, indicating that these messages will not be sent to the client.", but in this implementation infinity is used instead of 0 and ssh_options checks that a positive integer is presented;
  2. Keep-alive messages can't be sent during renegotiation, but since this feature acts as a keep-alive and a timeout, an equivalent timeout is established for the renegotiation procedure if alive is enable. This is implemented with a timeout called renegotiation_alive

Copy link
Contributor

CT Test Results

Tests are running... https://github.com/erlang/otp/actions/runs/12057006879

Results for commit 82454d3

To speed up review, make sure that you have read Contributing to Erlang/OTP and that all checks pass.

See the TESTING and DEVELOPMENT HowTo guides for details about how to run test locally.

Artifacts

  • No CT logs found
  • No HTML docs found
  • No Windows Installer found

// Erlang/OTP Github Action Bot

@alexandrejbr
Copy link
Author

@u3s this a feature I promised long time ago, if you are still interested in it please continue reading :)

I know you are short on time, but if you could give me some tips on how to create some tests for this would be appreciated.

I wanted to add tests at least these 3 scenarios:

  • Normal scenario client and server send alive messages (This one I have one idea how to test which would be using the ssh_dbg module, ssh_dbg:on([ssh_messages]) reveals the sending of the messages but it's kind of ugly to use a regex to get the keep alive message);
  • Timeout scenario. I would like that the server or client become not responsive and I would like to check that the connections is terminated (this one we have tested before suspending the openssh process but it's not so nice);
  • The renegotiation scenario in which the during the renegotiation the peer becomes unreachable and the timeout should have effect.

@alexandrejbr alexandrejbr force-pushed the alexandrejbr/ssh-keep-alive branch from 82454d3 to 62ef27e Compare November 27, 2024 21:10
@alexandrejbr alexandrejbr force-pushed the alexandrejbr/ssh-keep-alive branch from 62ef27e to 5b99b40 Compare November 27, 2024 21:13
@u3s u3s self-assigned this Nov 28, 2024
@u3s u3s added the team:PS Assigned to OTP team PS label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team:PS Assigned to OTP team PS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants