ssh

package
v1.10.5 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Placeholders are used for templated connections
	Placeholders = map[string]string{
		"@@USER_INITIAL_LASTNAME":          "{{.FirstNameInitial}}{{.LastName}}",
		"@@USER_LASTNAME_INITIAL":          "{{.LastName}}{{.FirstNameInitial}}",
		"@@USER_FIRSTNAME_INITIAL":         "{{.FirstName}}{{.LastNameInitial}}",
		"@@USER_FIRSTNAME.@@USER_LASTNAME": "{{.FirstName}}.{{.LastName}}",
		"@@USER_FIRSTNAME":                 "{{.FirstName}}",
		"@@" + cfg.EnvSSHUsername:          "{{.FullName}}",
	}

	// SkipOnEmpty bypasses display and use of empty values for ssh
	SkipOnEmpty = map[string]string{
		"ProxyJump": "none",
		"SendEnv":   "",
	}
)

Functions

func Connect

func Connect(args []string, e UserEnv)

Connect executes the SSH command args : options provided for inspection e : user environment settings

Types

type CachedConnection

type CachedConnection struct {
	Config string
}

CachedConnection contains a full config

type Connection

type Connection struct {
	HostName            string
	Port                uint16
	User                string
	LocalForward        []LocalForward
	IdentityFile        string
	IdentitiesOnly      bool
	ProxyJump           string
	SendEnv             string
	ServerAliveInterval uint16
	ServerAliveCountMax uint16
	Cache               CachedConnection
	ControlPath         string
	ForwardAgent        string
}

Connection stores the SSH properties

func (*Connection) BuildConnection

func (c *Connection) BuildConnection(args map[string]interface{}, key string, templateUser string) []string

BuildConnection creates the SSH command for execution args : options provided for inspection

type LocalForward

type LocalForward struct {
	LocalPort  uint16
	RemotePort uint16
	BindHost   string
}

LocalForward stores the port-forwarding details

type UserEnv

type UserEnv struct {
	User     string
	Simulate bool
}

UserEnv contains settings from the ENV

Jump to

Keyboard shortcuts

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