Skip to content

classx/ssh-tunnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ssh-tunnel

Overview

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.

Features

  • Easy-to-use CLI interface
  • YAML-based configuration support
  • Lightweight and efficient

Dependencies

  • clap (v4.0) with derive feature
  • serde (v1.0) with derive feature
  • serde_yaml (v0.9)

Usage

To use ssh-tunnel, ensure you have Rust installed. Then, build and run the project:

cargo build --release
./target/release/ssh-tunnel --help

Example: Starting an SSH Tunnel

Below is an example of how to start an SSH tunnel using the ssh-tunnel tool:

  1. Create a configuration file (e.g., ~/.tunnelrc or defined by TUNNEL_DIR environment 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
  1. Run the tool to start the tunnel:
./target/release/ssh-tunnel start [tunnel name]
  1. Check the status of the tunnel:
./target/release/ssh-tunnel status
  1. Stop the tunnel:
./target/release/ssh-tunnel stop [tunnel name]

License

This project is licensed under the MIT License.

About

Rust ssh port mapping

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages