LinuxCommandLibrary

mole

CLI application to easily create SSH tunnels

TLDR

Create a local SSH tunnel
$ mole new -source :[local_port] -destination [host]:[port] -server [user]@[ssh_server]
copy
Create a tunnel with auto-selected local port
$ mole new -destination [host]:[port] -server [user]@[ssh_server]
copy
Create multiple tunnels through one connection
$ mole new -destination [host1]:[port1] -destination [host2]:[port2] -server [user]@[ssh_server]
copy
Save a tunnel alias
$ mole new -alias [name] -destination [host]:[port] -server [user]@[ssh_server]
copy
Start a saved tunnel
$ mole start [name]
copy

SYNOPSIS

mole command [options]

DESCRIPTION

mole is a CLI application for creating SSH tunnels with a focus on resiliency and user experience. It forwards local ports to remote addresses through SSH servers, supports multiple tunnels over a single connection, and leverages SSH config file settings.
Tunnel configurations can be saved as aliases for quick reuse.

PARAMETERS

-source :[PORT]

Local port to listen on. Auto-selected if not specified.
-destination HOST:PORT
Remote destination to forward to.
-server USER@HOST
SSH server to tunnel through.
-alias NAME
Save the tunnel configuration under an alias.

CAVEATS

Requires SSH access to the tunnel server. Authentication uses the system's SSH configuration and keys.

HISTORY

mole was created by davrodpin and is written in Go.

SEE ALSO

ssh(1), autossh(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard