Crates.io | pssh-rs |
lib.rs | pssh-rs |
version | 0.2.7 |
source | src |
created_at | 2022-12-03 15:18:52.181746 |
updated_at | 2023-02-21 07:27:04.505063 |
description | pssh-rs is a parallel ssh tool written in rust. |
homepage | |
repository | |
max_upload_size | |
id | 729149 |
size | 28,616 |
pssh-rs is a parallel ssh tool written in rust.
date
command on 192.168.56.101 and 192.168.56.102:./pssh-rs -h "192.168.56.101;192.168.56.102" -uroot -pmypassword -c 'date'
the hosts can be separated by comma, semicolon or spaces.
$ cat ./hosts.toml
username = "root"
password = "aaa"
port = 22
hosts = [
"192.168.56.101",
"192.168.56.102"
]
[nginx]
username = "ubuntu"
password = "bbb"
port = 22
hosts = [
"192.168.57.101",
"192.168.57.102"
]
[[nginx.host]]
host = "192.168.57.103"
password = "ccc"
port = 36000
[[nginx.host]]
host = "192.168.57.104"
username = "root"
password = "ddd"
port = 36000
execute date
on all nginx hosts
./pssh-rs -t hosts.toml -s nginx -c 'date'
note that the username of 192.168.57.103 is ubuntu, which inherited from its parent nginx section.
just run cargo install pssh-rs
to install.
pssh-rs can be built with cargo build --release
, or using the following
command to build statically:
sudo apt install musl-tools -y
rustup target add x86_64-unknown-linux-musl
cargo build --target=x86_64-unknown-linux-musl --release