A project to manage multiple ssh connections simultaniously
Go to file
2025-10-05 22:03:01 +02:00
src Add flake 2025-10-05 22:02:13 +02:00
test-ressources Improve command error messages and unit test coverage 2024-12-18 11:35:38 +01:00
.gitignore init 2024-12-11 10:42:44 +01:00
Cargo.lock Add flake 2025-10-05 22:02:13 +02:00
Cargo.toml Rename working-directory flag to download-directory and use ~/Downloads as default download directory 2025-02-01 13:52:34 +01:00
flake.lock Add flake 2025-10-05 22:02:13 +02:00
flake.nix Add flake 2025-10-05 22:02:13 +02:00
README.md Support uploading multiple files 2025-02-02 22:04:59 +01:00
rustfmt.toml init 2024-12-11 10:42:44 +01:00

multi-ssh

An application to upload or edit a file or perform a command on multiple servers via ssh and scp.

Configuration

Set the environment variable MSSH_SERVERS to configure the server directories of your ssh servers. Use the MSSH_EDITOR variable to configure your editor command. Furthermore, ensure that in your shell the following commands are set up and working:

  • ssh
  • scp
  • ssh-agent
  • ssh-add

Ergo you should be able to connect to your desired servers via ssh and be able to start an ssh agent.

Environment variable setup example for linux

export MSSH_SERVERS="crea:server/creative2,sky:sky,city:city2,.:minecraft-server"
export MSSH_EDITOR="kate -b <file>" #<file> is the placeholder for the file name

localhost as server-target

You may also use . to refer to your local minecraft server, without having to open the ssh port. You still have to define the server directory though.

Usage

For detailed usage please see:

multi-ssh --help

Command example

Delete the WorldGuard folder on crea, sky and city:

multi-ssh crea sky city -c "rm -r plugins/WorldGuard" 

Upload example

Upload a new version of the MenuApi plugin and delete old versions from the servers:

multi-ssh crea sky city minez lobby -u target/MenuApi-3.4.2.jar 

Upload a new version of the MineZ plugin from the MineZ-Dev and keep backups of the older versions:

multi-ssh minez -u -S minez-dev plugins/MineZ-3.0.jar -a 

Upload of multiple files is also supported.

The program will show you an overview of what it will be doing before actually performing any of the actions:

minez (minez3/plugins):
* renaming MineZ-2.7.jar -> MineZ-2.7.jarr
+ adding MineZ-3.0.jar
Continue [Y|n]: 

For detailed usage of the upload feature see

multi-ssh -u --help

Editor example

Edit the server properties of steptech

multi-ssh steptech -e server.properties

This will create a copy of the file in your ~/Downloads directory. That directory can be changed using the -d flag.

Building from source

This is a rust project so you will need rust and cargo.

Once you have that installed, just run

cargo build --release

and you will find an executable in target/release.

Unit tests

In order for the unit tests to pass, you will need python3.