rust实现的ssh2.0客户端。
如果在使用中遇到任何问题,欢迎 issues 或者 PR 。
fn main() {
let session = ssh::create_session()
.username("ubuntu")
.password("password")
.connect("ip:port")
.unwrap()
.run_local();
}
fn main() {
let session = ssh::create_session()
.username("ubuntu")
.password("password")
.private_key_path("./id_rsa") // 文件地址
.connect("ip:port")
.unwrap()
.run_local();
}
fn main() {
let session = ssh::create_session()
.username("ubuntu")
.password("password")
.private_key("rsa_string") // 文件字符串
.connect("ip:port")
.unwrap()
.run_local();
}
ssh::debug();
ssh::create_session().timeout(Some(std::time::Duration::from_secs(5)));
curve25519-sha256
ecdh-sha2-nistp256
ssh-ed25519
rsa-sha2-512
rsa-sha2-256
rsa-sha
(features = ["dangerous-rsa-sha1"])
chacha20-poly1305@openssh.com
aes128-ctr
aes192-ctr
aes256-ctr
chacha20-poly1305@openssh.com
aes128-ctr
hmac-sha1
hmac-sha1
none
none