openssh

package
v0.0.0-...-b872246 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddVMKey

func AddVMKey(hostname, key string) error

AddVMKey sets the private SSH key for the given Devbox VM host. If a key was previously set for the host, AddVMKey replaces it with the new key. The old key is not recoverable.

AddVMKey only manages keys specific to Devbox Cloud. It will not touch any of the user's keys in ~/.ssh.

func EnsureDirExists

func EnsureDirExists(path string, perm fs.FileMode, chmod bool) error

func GithubUsernameFromLocalFile

func GithubUsernameFromLocalFile() (string, error)

func SaveGithubUsernameToLocalFile

func SaveGithubUsernameToLocalFile(username string) error

func SetupDevbox

func SetupDevbox() error

SetupDevbox updates the user's OpenSSH configuration so that they can connect to Devbox Cloud hosts. It does nothing if Devbox Cloud is already configured.

func SetupInsecureDebug

func SetupInsecureDebug(gatewayAddr string) error

SetupInsecureDebug is like SetupDevbox, but also configures an additional gateway with host key checking disabled. If gatewayAddr is a well-known *.synopkg.github.io/devbox gateway, then SetupInsecureDebug doesn't add any extra hosts and acts identically to SetupDevbox.

Types

type Cmd

type Cmd struct {
	// DestinationAddr is a "hostname[:port]" that specifies the remote host
	// and port to connect to.
	DestinationAddr string

	// Username is the remote login name.
	Username string

	PathInVM       string
	ShellStartTime string // unix timestamp
}

func Command

func Command(user, dest string) *Cmd

func (*Cmd) ExecRemote

func (c *Cmd) ExecRemote(cmd string) ([]byte, error)

func (*Cmd) ExecRemoteWithRetry

func (c *Cmd) ExecRemoteWithRetry(cmd string, retries, maxWait int) ([]byte, error)

ExecRemoteWithRetry runs the given command on the remote host, retrying with an exponential backoff if the command fails. maxWait is the maximum seconds we wait in between retries.

func (*Cmd) Shell

func (c *Cmd) Shell(w io.Writer) error

type ControlSocket

type ControlSocket struct {
	Path string
	Host string
}

func DevboxControlSockets

func DevboxControlSockets() []ControlSocket

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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