gotnl

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2024 License: MIT Imports: 8 Imported by: 0

README

SSH Tunneling Package

This Go package provides functionality for establishing and managing SSH tunnels.
It simplifies the process of setting up secure SSH connections,
making it easier to securely connect to remote servers.

Features

  • Easy setup of SSH tunnels
  • Secure handling of SSH authentication

Usage

This package can be used in any Go application that requires secure SSH connections and tunneling functionality.

Installation

Use the standard go get command to install this package:

go get github.com/mrguamos/gotnl

How to use

client, listener, err := gotnl.Tunnel(gotnl.Config{
    BastionHost: "bastion.host.com",
    BastionPort: "22",
    BastionUser: "ec2-user",
    TargetHost:  "rds.com",
    TargetPort:  "5432",
    LocalPort:   "5433",
    SSHKey:      "/Users/user/key",
    Passphrase:  "optional",
})
if err != nil {
    log.Fatal(err)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tunnel

func Tunnel(cfg Config) (*ssh.Client, net.Listener, error)

Types

type Config

type Config struct {
	BastionHost string
	BastionPort string
	BastionUser string
	TargetHost  string
	TargetPort  string
	LocalPort   string
	SSHKey      string
	Passphrase  string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL