Comments (4)
Hi,
May I have a copy of your PoC code?
It looks strange cuz this assert is only to test the first 4 bytes of the ssh server replies when we connected.
According to the RFC, it must be "SSH-xxxxxx", which in ASCII is [83, 83, 72, 45, xxxxx]
A fatal here is that we shall throw an error rather than panic. But if you're connecting a true ssh server, it is worth investigating more about how could it happen.
BRs.
from ssh-rs.
Hi, thank you for your help.
Ssh Server : OpenSSH_8.9p1
PoC
use ssh;
use std::thread::{self, JoinHandle};
use std::thread::available_parallelism;
fn main() {
//let default_parallelism_approx = available_parallelism().unwrap().get();
let default_parallelism_approx = 11;
let mut threads = Vec::<JoinHandle<()>>::new();
for i in 0..default_parallelism_approx {
let mut start = i;
let e = thread::spawn(move || {
let session_name = "Admin";
let password = "12345678";
while start < 10000 {
let connection = ssh::create_session()
.username(&session_name)
.password(&password)
.connect("wwww.website.com:22");
}
});
threads.push(e);
}
for _u in 0..default_parallelism_approx {
let r = threads.pop().unwrap();
let _ = r.join();
}
}
from ssh-rs.
Hi @Paulo-21
With #78 it now returns an error SshError::VersionDismatchError
rather than panic.
It's actually some error message which indicates that the server is not able to handle more clients.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: VersionDismatchError { our: "SSH-2.0-SSH_RS-0.4.1", their: "Exceeded MaxStartups" }', exec/src/main.rs:38:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: VersionDismatchError { our: "SSH-2.0-SSH_RS-0.4.1", their: "Exceeded MaxStartups" }', exec/src/main.rs:38:18
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: VersionDismatchError { our: "SSH-2.0-SSH_RS-0.4.1", their: "Exceeded MaxStartups" }', exec/src/main.rs:38:18
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: VersionDismatchError { our: "SSH-2.0-SSH_RS-0.4.1", their: "Exceeded MaxStartups" }', exec/src/main.rs:38:18
I'll later have 0.4.2 released to include the fix.
Thank you for reporting!
BRs.
from ssh-rs.
Hi @HsuJv
Thank you for your reactivity.
from ssh-rs.
Related Issues (20)
- 是否可以在登录的时候设置StrictHostKeyChecking属性? HOT 8
- 增加任务状态的建议 HOT 1
- How to obtain SshError HOT 8
- Only captures stdout HOT 2
- add more encryption algorithms HOT 3
- Bump ssh-key crate version HOT 4
- `tracing` dependency is not new enough
- Error when connecting to older ExtremeXOS switch HOT 1
- 能否支持一边读取命令执行结果一遍输出,而不是等到整个命令完全执行完毕再输出所有的结果? HOT 1
- ssh -rs crashed on Zero lenght version information HOT 4
- Use Rust std TCP set_read_TimeOut instead of a custum one ? HOT 3
- add connect_with_timeout to set connection timeout HOT 4
- Getting command exit status HOT 3
- Scp: quoting errors with spaces in dest filename HOT 5
- Scp: track progress for larger transfers HOT 2
- Scp: path-related bugs on windows HOT 1
- OpenSSH client drop-in replacement
- [email protected] request ignored HOT 1
- "Auth error" against freebsd HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssh-rs.