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

Looping ssh connection Timeout #20

Closed
Paulo-21 opened this issue Sep 18, 2022 · 9 comments
Closed

Looping ssh connection Timeout #20

Paulo-21 opened this issue Sep 18, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@Paulo-21
Copy link

Paulo-21 commented Sep 18, 2022

Hey, i was wondoring if it could possible to do that, because i'm encounring difficuties.
The first connection connects successfully but all subsequent connections return an error on session.connect()

if i do session.connect().unwrap() :
thread 'main' panicked at 'called "Result::unwrap()" on an "Err" value: Error: { Kind(Timeout), Message(time out.) }

{ Kind(Timeout) }

loop {
  let mut session: Session = ssh::create_session();
  session.set_timeout(3);
  session.set_user_and_password("user", "password");
  match session.connect("127.0.0.1:22") {
         Ok(_res) => {
              //Do something
         },
         Err(_err) => {
              //handle error
        }
  }
session.close().unwrap();
}

Thank you

@Paulo-21 Paulo-21 changed the title Looping ssh connection Looping ssh connection Timeout Sep 18, 2022
@r3dlight
Copy link
Contributor

r3dlight commented Sep 19, 2022

Same issue here with ssh-rs = "0.2.0".
Not using it in a loop but I get these timeout messages as well after closing the first successful connection.
Bad packets received in my SSH server logs.

@1148118271
Copy link
Owner

Sorry, I have a problem with my code and I need to fix it, thank you very much for your feedback.

@1148118271 1148118271 added the bug Something isn't working label Sep 19, 2022
@r3dlight
Copy link
Contributor

No problem, thank you for your work ! Keep us in touch :)

1148118271 added a commit that referenced this issue Sep 19, 2022
@Paulo-21
Copy link
Author

Yeah no problemo amigo, nice work anyway :)

@1148118271 1148118271 mentioned this issue Sep 23, 2022
Merged
1148118271 added a commit that referenced this issue Sep 23, 2022
#20 Solved the problem of not being able to connect multiple times in a process, which will be released in a future version.
@Paulo-21
Copy link
Author

Did you plan to release an 0.2.1 version ?
Thank you for your reactivitie

@1148118271
Copy link
Owner

Yes, it is expected to be released in the next few days.

@1148118271
Copy link
Owner

v0.2.1 released

@r3dlight
Copy link
Contributor

It seems to work for me, thank you !

@Paulo-21
Copy link
Author

Updated, thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants