tunn: Simplify SSH Tunnel Management with YAML Configuration
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
tunn is a Go-based tool that simplifies the management of SSH tunnels. It allows users to define and launch multiple SSH tunnels using a single YAML configuration file, leveraging existing OpenSSH setups. This utility streamlines the process of connecting to remote services, offering features like parallel execution and daemon mode for background operation.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
tunn is an open-source tool written in Go, designed to simplify the creation and management of SSH tunnels. It acts as a developer-friendly wrapper around OpenSSH, enabling users to define and control multiple tunnels through a single, intuitive YAML configuration file. This utility is ideal for developers and system administrators who frequently need to establish secure connections to remote services, such as databases or APIs, without complex manual commands.
Installation
tunn offers several straightforward installation methods to get you up and running quickly.
Quick Install
curl -sSL https://raw.githubusercontent.com/strandnerd/tunn/main/scripts/install.sh | sh
From Go Install
Ensure you have Go 1.21 or higher installed.
go install github.com/strandnerd/tunn@latest
Build Locally
git clone https://github.com/strandnerd/tunn.git
cd tunn
go build -o tunn
sudo mv tunn /usr/local/bin/
Examples
tunn makes managing SSH tunnels intuitive with its YAML configuration and simple command-line interface.
Configuration
Create a ~/.tunnrc file in your home directory to define your tunnels:
tunnels:
api:
host: myserver # SSH host from ~/.ssh/config
ports:
- 3000:3000 # local:remote port mapping
- 4000:4001
user: apiuser # optional: SSH user
identity_file: ~/.ssh/id_rsa # optional: SSH key
db:
host: database
ports:
- 3306:3306 # MySQL
- 5432:5432 # PostgreSQL
user: dbadmin # optional: overrides SSH config
cache:
host: cacheserver
ports:
- 6379:6379 # Redis
Ensure your SSH hosts are defined in ~/.ssh/config, for example:
Host myserver
HostName 192.168.1.100
User myuser
Port 22
Usage
Run All Tunnels:
tunn
Run Specific Tunnels:
# Single tunnel
tunn api
# Multiple tunnels
tunn api db
Run Tunnels in the Background (Daemon Mode):
tunn --detach
This command detaches tunn to run as a background service.
Check Daemon Status:
tunn status
This reports the PID, mode, and port states for managed tunnels.
Stop the Daemon:
tunn stop
This command cleanly shuts down the tunn daemon.
Why Use tunn?
tunn stands out for its simplicity and powerful features, making it an excellent choice for managing SSH tunnels:
- Simple Configuration: Define all your tunnels in a single, easy-to-read YAML file.
- Leverages Existing SSH Setup: Integrates seamlessly with your
~/.ssh/configand existing SSH keys. - Parallel Execution: All defined tunnels run concurrently, improving efficiency.
- Daemon Mode: Run tunnels as a background service, freeing up your terminal.
- Fine-Grained Control: Run all tunnels or selectively launch specific ones by name.
- Go Module: A lean Go module with minimal dependencies, ensuring clean and portable builds.
Links
For more detailed information, contributions, or to report issues, visit the official GitHub repository:
Related repositories
Similar repositories that may be relevant next.
nebula-sync: Effortlessly Synchronize Your Pi-hole Configurations
May 2, 2026
nebula-sync is a powerful tool designed to synchronize configurations across multiple Pi-hole v6.x instances. Developed in Go, it offers both full and selective synchronization options, ensuring your ad-blocking setup remains consistent and up-to-date across your network. This project simplifies the management of distributed Pi-hole deployments.
Froggit: A Modern, Minimalist Git TUI for Streamlined Workflow
April 14, 2026
Froggit is a modern, minimalist Git Terminal User Interface (TUI) designed to simplify your Git workflow. It offers visual feedback, keyboard-driven controls, and seamless integration with your terminal, enhancing clarity and speed for common Git operations. Built with Go, Froggit provides a fast and efficient way to manage your repositories across Windows, Linux, and macOS.

Neko: A Self-Hosted Virtual Browser for Collaborative and Secure Web Access
April 1, 2026
Neko is an innovative self-hosted virtual browser that leverages Docker and WebRTC technology to provide secure and private internet access. It enables users to run a fully functional browser in an isolated environment, supporting multiple participants for collaborative activities like watch parties and interactive presentations. This versatile tool offers a robust solution for both individual privacy and team-based online interactions.

CasaOS: Your Personal Open-Source Cloud System for Home Servers
March 22, 2026
CasaOS is an elegant, open-source personal cloud system designed for simplicity and ease of use. It empowers individuals to transform various hardware, from Raspberry Pis to old computers, into a robust home server. With a friendly UI and one-click app installations, CasaOS enables users to manage their data, host applications, and build a personalized digital home experience.
Source repository
Open the original repository on GitHub.
6 counted GitHub visits