Documentation
¶
Index ¶
- Constants
- func StartParallelForwards(connect *sshlib.Connect, config conf.ServerConfig) error
- type AuthKey
- type PathSet
- type Run
- func (r *Run) CreateAuthMethodMap()
- func (r *Run) CreateSshConnect(server string) (connect *sshlib.Connect, err error)
- func (r *Run) CreateSshConnectDirect(server string) (connect *sshlib.Connect, err error)
- func (r *Run) ParallelIgnoredFeatures(server string) []string
- func (r *Run) PrepareParallelForwardConfig(server string) (c conf.ServerConfig)
- func (r *Run) PrintConnectInfo(server string, connect *sshlib.Connect, cfg conf.ServerConfig)
- func (r *Run) PrintSelectServer()
- func (r *Run) SetupSshAgent()
- func (r *Run) Start()
Constants ¶
const ( AUTHKEY_PASSWORD = "password" AUTHKEY_AGENT = "agent" AUTHKEY_KEY = "key" AUTHKEY_CERT = "cert" AUTHKEY_PKCS11 = "pkcs11" )
const SSH_AUTH_SOCK = "SSH_AUTH_SOCK"
Variables ¶
This section is empty.
Functions ¶
func StartParallelForwards ¶ added in v0.8.0
func StartParallelForwards(connect *sshlib.Connect, config conf.ServerConfig) error
StartParallelForwards starts only the reverse-side forwards that can be applied independently per connection in parallel workflows.
Types ¶
type AuthKey ¶
type AuthKey struct {
// auth type:
// - password
// - agent
// - key
// - cert
// - pkcs11
Type string
// auth type value:
// - key(path)
// ex.) ~/.ssh/id_rsa
// - cert(path)
// ex.) ~/.ssh/id_rsa.crt
// - pkcs11(libpath)
// ex.) /usr/local/lib/opensc-pkcs11.so
Value string
}
AuthKey Auth map key struct.
type Run ¶
type Run struct {
ServerList []string
Conf conf.Config
// ControlMasterOverride temporarily overrides the config setting for
// this run. nil means use the config value as-is.
ControlMasterOverride *bool
// Mode value in
// - shell
// - cmd
Mode string
// tty use (-t option)
IsTerm bool
// parallel connect (-p option)
IsParallel bool
// not run (-N option)
IsNone bool
// x11 forwarding (-X option)
X11 bool
// Trusted X11 flag (-Y option)
X11Trusted bool
// use or not-use local bashrc.
// IsNotBashrc takes precedence.
IsBashrc bool
IsNotBashrc bool
// local/remote Port Forwarding
PortForward []*conf.PortForward
// TODO(blacknon): Delete old keys
// L or R
PortForwardMode string
// local port num (ex. 11080).
PortForwardLocal string
// remote host and port (ex. localhost:11080).
PortForwardRemote string
// Dynamic Port Forwarding
// set localhost port num (ex. 11080).
DynamicPortForward string
// HTTP Dynamic Port Forwarding
// set localhost port num (ex. 11080).
HTTPDynamicPortForward string
// Reverse Dynamic Port Forwarding
// set remotehost port num (ex. 11080).
ReverseDynamicPortForward string
// HTTP Reverse Dynamic Port Forwarding
// set remotehost port num (ex. 11080).
HTTPReverseDynamicPortForward string
// NFS Dynamic Forward
// set localhost port num (ex. 12049).
NFSDynamicForwardPort string
// NFS Dynamic Forward Path
// set remotehost path (ex. /path/to/remote).
NFSDynamicForwardPath string
// NFS Reverse Dynamic Forward
// set remotehost port num (ex. 12049).
NFSReverseDynamicForwardPort string
// NFS Reverse Dynamic Forward Path
// set localhost path (ex. /path/to/local).
NFSReverseDynamicForwardPath string
// SMB Dynamic Forward
// set localhost port num (ex. 12445).
SMBDynamicForwardPort string
// SMB Dynamic Forward Path
// set remotehost path (ex. /path/to/remote).
SMBDynamicForwardPath string
// SMB Reverse Dynamic Forward
// set remotehost port num (ex. 12445).
SMBReverseDynamicForwardPort string
// SMB Reverse Dynamic Forward Path
// set localhost path (ex. /path/to/local).
SMBReverseDynamicForwardPath string
// Tunnel device (-w equivalent). Enable and units.
TunnelEnabled bool
TunnelLocal int
TunnelRemote int
// Exec command
ExecCmd []string
// enable/disable print header in command mode
EnableHeader bool
DisableHeader bool
// Enable/Disable stdoutMutex
EnableStdoutMutex bool
// StdinData from pipe flag
IsStdinPipe bool
ShareConnect bool
// ActiveTunnel holds the active tunnel created for this Run (if any)
ActiveTunnel *sshlib.Tunnel
// contains filtered or unexported fields
}
Run
func (*Run) CreateAuthMethodMap ¶
func (r *Run) CreateAuthMethodMap()
CreateAuthMethodMap Create ssh.AuthMethod, into r.AuthMethodMap.
func (*Run) CreateSshConnect ¶
CreateSshConnect return *sshlib.Connect this vaule in ssh.Client with proxy.
func (*Run) CreateSshConnectDirect ¶
CreateSshConnectDirect returns *sshlib.Connect with ControlMaster/ControlPersist disabled. This is used by features that require a concrete *ssh.Client (e.g. SFTP clients).
func (*Run) ParallelIgnoredFeatures ¶ added in v0.8.0
ParallelIgnoredFeatures lists forwarding settings that are intentionally skipped for per-host parallel sessions because they require local listeners.
func (*Run) PrepareParallelForwardConfig ¶ added in v0.8.0
func (r *Run) PrepareParallelForwardConfig(server string) (c conf.ServerConfig)
PrepareParallelForwardConfig returns only the forwarding settings that are safe to apply independently to each parallel connection.
func (*Run) PrintConnectInfo ¶
PrintConnectInfo centralizes informational output related to a created connection (ControlMaster state, local rc usage, etc.). Call this after CreateSshConnect returns a valid *sshlib.Connect.
func (*Run) PrintSelectServer ¶
func (r *Run) PrintSelectServer()
PrintSelectServer is printout select server. use ssh login header.
func (*Run) SetupSshAgent ¶
func (r *Run) SetupSshAgent()