sshproxy

package module
v0.0.0-...-5541a20 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: GPL-2.0 Imports: 10 Imported by: 1

README

sshproxy

SSH Proxy / Load balancer

Copyright (C) 2014 Thomas Habets thomas@habets.se

Description

SSHProxy proxies an SSH connection over SSL, to allow:

  • A client to use an SSH key they don't have access to. Therefore they can't go around the proxy, or lose the key.
  • Logging of everything typed and received through the proxy (optional).

For setup instructions, see this blog post.

-auth=key

With -auth=key the client will use PubkeyAuthentication to authenticate to SSHProxy, and SSHProxy will use the key specified in -client_keyfile to log in to the server.

-auth=kbi

With -auth=kbi SSHProxy will forward the password from the client on to the server.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handshake

type Handshake interface {
	// Handshake handshakes downstream client, and returns a channel where the client object is then sent.
	// Because this function has to be run *concurrently* with ssh.NewServerConn(), it's never right to
	// call this synchronously, and the API makes that clear.
	Handshake(conf *ssh.ServerConfig, target string) <-chan *ssh.Client
}

Handshake is the auth type proxied.

type SSHProxy

type SSHProxy struct {
	// Conn is the connection to downstream client.
	Conn net.Conn

	// Forwarded-for address.
	Forwarded string

	// Target is the name of the upstream server.
	Target string

	// Auther is the handshake implementation.
	Auther Handshake

	// PrivateKey is the private key of the SSHProxy server.
	PrivateKey ssh.Signer

	// Logging settings.
	LogUpstream, LogDownstream bool
	LogDir                     string
	// contains filtered or unexported fields
}

SSHProxy proxies a connection to a target.

func (*SSHProxy) Run

func (p *SSHProxy) Run()

Run handshakes and handles the connection.

Directories

Path Synopsis
./listener -listen 0.0.0.0:2022 ./next-program -conn_fd '{}'
./listener -listen 0.0.0.0:2022 ./next-program -conn_fd '{}'

Jump to

Keyboard shortcuts

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