Help us shape the future of Go! Take the 2026 Go Developer Survey

ssh

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KnownHostsFileName = "d8virtualization_known_hosts"

	IdentityFilePathFlag, _ = "identity-file", "i"
)

Variables

This section is empty.

Functions

func AddCommandlineArgs

func AddCommandlineArgs(flagset *pflag.FlagSet, opts *SSHOptions)

func InteractiveHostKeyCallback

func InteractiveHostKeyCallback(knownHostsFilePath string) (ssh.HostKeyCallback, error)

InteractiveHostKeyCallback verifying the host key against known_hosts and adding the key if the user replies accordingly.

func NewCommand

func NewCommand() *cobra.Command

func PrepareCommand

func PrepareCommand(cmd *cobra.Command, defaultNamespace string, opts *SSHOptions, args []string) (namespace, name string, err error)

func RunLocalClient

func RunLocalClient(cmd *cobra.Command, namespace, name string, options *SSHOptions, clientArgs []string) error

Types

type NativeSSHConnection

type NativeSSHConnection struct {
	// contains filtered or unexported fields
}

func NewNativeSSHConnection

func NewNativeSSHConnection(virtClient kubeclient.Client, options SSHOptions) *NativeSSHConnection

func (*NativeSSHConnection) PrepareSSHClient

func (o *NativeSSHConnection) PrepareSSHClient(namespace, name string) (*ssh.Client, error)

func (*NativeSSHConnection) StartSession

func (o *NativeSSHConnection) StartSession(client *ssh.Client, command string) error

type SSH

type SSH struct {
	// contains filtered or unexported fields
}

func (*SSH) Run

func (o *SSH) Run(cmd *cobra.Command, args []string) error

type SSHOptions

type SSHOptions struct {
	SSHPort                   int
	SSHUsername               string
	IdentityFilePath          string
	IdentityFilePathProvided  bool
	KnownHostsFilePath        string
	KnownHostsFilePathDefault string
	AdditionalSSHLocalOptions []string
	WrapLocalSSH              bool
	LocalClientName           string
}

func DefaultSSHOptions

func DefaultSSHOptions() SSHOptions

Jump to

Keyboard shortcuts

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