Skip to content

Save SSH tunnel configurations and start a tunnel with port forwarding using one of the saved configurations.

Notifications You must be signed in to change notification settings

shripadrayewar/ssh-tunnel-manager

 
 

Repository files navigation

SSH Tunnel Manager (sshtm)

SSH Tunnel Manager (sshtm) allows you to manage SSH tunnel configurations for easy setup and use of port forwarding via SSH.

Current Version

SSH Tunnel Manager (sshtm) v1.0.7

Ensure you are using the latest version to benefit from the newest features and improvements.

Features

  • Save Configuration: Store SSH tunnel configurations including descriptions for later use.
  • Start Tunnel: Initiate an SSH tunnel using a saved configuration, similar to the SSH command ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER.
  • List Configurations: Display all saved SSH tunnel configurations.
  • Remove Configuration: Delete a saved SSH tunnel configuration.

Requirements

To build and run sshtm, you must have the following installed on your system:

  • Go (Golang): Ensure you have Go installed (version 1.15 or later is recommended). You can check your current Go version using go version.
  • Git: Needed for cloning the repository and potentially fetching dependencies.
  • Air (optional for development): For live reloading during development. Install Air by following the instructions at Air GitHub Repository.

Installation

Build from source

Clone the repository and run ./install.sh:

git clone https://github.com/besrabasant/ssh-tunnel-manager.git
cd ssh-tunnel-manager
./install.sh

This script compiles the binaries and installs them under ~/.local/bin.

Arch Linux (AUR)

If you use yay, install directly from the AUR:

yay -S sshtm

You can also build the package manually with makepkg inside packaging/arch.

Debian/Ubuntu

Build a deb package using the files in packaging/debian:

cd packaging/debian
dpkg-buildpackage -us -uc
sudo dpkg -i ../sshtm_1.0.7-1_amd64.deb

Uninstallation

~/.local/share/sshtm/scripts/uninstall.sh

Basic Usage

sshtm [command]

Commands

Below is the list of available commands in sshtm, with descriptions for each:

Command Aliases Description
list ls, l List all SSH tunnel configurations, optionally filtering by a search pattern. (You can use a pattern to only list the configurations that fuzzy match that pattern)
add a Add a new SSH tunnel configuration.
edit e Edit an existing SSH tunnel configuration.
delete del, d Delete an existing SSH tunnel configuration.
tunnel t Start an SSH tunnel using a saved configuration, optionally specifying a local port.
active List all active SSH tunnels.
kill k,terminate Terminate an active SSH tunnel.
help Display help about any command.
completion Generate the autocompletion script for the specified shell.
version Print the version number of SSH Tunnel Manager

Development

  1. Start daemon : To start the sshtm background service for development, run:

     make gen_proto
     air

    This command assumes you have Air installed for live reloading during development. It should be executed from the project root directory.

  2. Use the CLI : To interact with sshtm via the command line interface during development, navigate to the client directory:

    cd client
    go run main.go [command] [arguments]

    Here, [command] is one of the commands available and [arguments] represents additional arguments that can be passed to the command.

Versioning Policy

This project uses Semantic Versioning (SemVer) for version numbers.

About

Save SSH tunnel configurations and start a tunnel with port forwarding using one of the saved configurations.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 96.3%
  • Shell 2.2%
  • Makefile 1.5%