ssh

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Copyright (C) 2016 Krešimir Nesek * Copyright (C) 2021 Piers Harding * * Based on blog post by Svett Ralchev: http://blog.ralch.com/tutorial/golang-ssh-tunneling/ * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details.

Index

Constants

This section is empty.

Variables

View Source
var (
	Trace *log.Logger
	Info  *log.Logger
	Error *log.Logger
)

Functions

func GetUser

func GetUser() (string, error)

func SSHAgent

func SSHAgent() ssh.AuthMethod

Types

type Endpoint

type Endpoint struct {
	Host string
	Port int
}

func (*Endpoint) String

func (endpoint *Endpoint) String() string

type SSHTunnel

type SSHTunnel struct {
	Local        *Endpoint
	Server       *Endpoint
	Remote       *Endpoint
	Intermediate *Endpoint

	Config *ssh.ClientConfig
}

func NewSSHTunnel

func NewSSHTunnel(sshUser string, sshHost string, sshPort int, sshHopHost string, sshHopPort int, localPort int,
	remoteHost string, remotePort int) *SSHTunnel

func NewSSHTunnelFromHostStrings

func NewSSHTunnelFromHostStrings(sshHostDef string, sshHopDef string, tunnelDef string) *SSHTunnel

sshHostDef user@sshhost.tld:port tunnelDef local_port:remote_host:remote_port

func (*SSHTunnel) Start

func (tunnel *SSHTunnel) Start() error

Jump to

Keyboard shortcuts

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