ssh-tunnel is a Rust-based command-line tool designed to simplify the creation and management of SSH tunnels. It leverages the power of the clap crate for argument parsing and serde for configuration handling.
- Easy-to-use CLI interface
- YAML-based configuration support
- Lightweight and efficient
clap(v4.0) withderivefeatureserde(v1.0) withderivefeatureserde_yaml(v0.9)
To use ssh-tunnel, ensure you have Rust installed. Then, build and run the project:
cargo build --release
./target/release/ssh-tunnel --helpBelow is an example of how to start an SSH tunnel using the ssh-tunnel tool:
- Create a configuration file (e.g.,
~/.tunnelrcor defined byTUNNEL_DIRenvironment variable) with the following content:
tunnels:
api:
host: api.srv1.com
ports:
- 8080:8080
user: username1
identity_file: ~/.ssh/id_rsa
db:
host: db.srv1.com
ports:
- 3306:3306
user: username2
- Run the tool to start the tunnel:
./target/release/ssh-tunnel start [tunnel name]
- Check the status of the tunnel:
./target/release/ssh-tunnel status
- Stop the tunnel:
./target/release/ssh-tunnel stop [tunnel name]
This project is licensed under the MIT License.