Documentation ¶
Index ¶
- Constants
- Variables
- func CommonOpts(sshPath string, useDotSSH bool) ([]string, error)
- func DetectOpenSSHVersion(ssh string) semver.Version
- func Format(w io.Writer, sshPath, instName string, format FormatT, opts []string) error
- func ParseOpenSSHVersion(version []byte) *semver.Version
- func SSHArgsFromOpts(opts []string) []string
- func SSHArguments() (arg0 string, arg0Args []string, err error)
- func SSHOpts(sshPath, instDir, username string, ...) ([]string, error)
- type FormatT
- type PubKey
Constants ¶
const ( // FormatCmd prints the full ssh command line. // // ssh -o IdentityFile="/Users/example/.lima/_config/user" -o User=example -o Hostname=127.0.0.1 -o Port=60022 lima-default FormatCmd = FormatT("cmd") // FormatArgs is similar to FormatCmd but omits "ssh" and the destination address. // // -o IdentityFile="/Users/example/.lima/_config/user" -o User=example -o Hostname=127.0.0.1 -o Port=60022 FormatArgs = FormatT("args") // FormatOptions prints the ssh option key value pairs. // // IdentityFile="/Users/example/.lima/_config/user" // User=example // Hostname=127.0.0.1 // Port=60022 FormatOptions = FormatT("options") // FormatConfig uses the ~/.ssh/config format // // Host lima-default // IdentityFile "/Users/example/.lima/_config/user " // User example // Hostname 127.0.0.1 // Port 60022 FormatConfig = FormatT("config") )
const EnvShellSSH = "SSH"
Environment variable that allows configuring the command (alias) to execute in place of the 'ssh' executable.
Variables ¶
var Formats = []FormatT{FormatCmd, FormatArgs, FormatOptions, FormatConfig}
Formats is the list of the supported formats.
Functions ¶
func CommonOpts ¶ added in v0.7.2
CommonOpts returns ssh option key-value pairs like {"IdentityFile=/path/to/id_foo"}. The result may contain different values with the same key.
The result always contains the IdentityFile option. The result never contains the Port option.
func DetectOpenSSHVersion ¶ added in v0.7.4
func ParseOpenSSHVersion ¶ added in v0.7.2
func SSHArgsFromOpts ¶ added in v0.7.2
SSHArgsFromOpts returns ssh args from opts. The result always contains {"-F", "/dev/null} in addition to {"-o", "KEY=VALUE", ...}.
func SSHArguments ¶ added in v1.0.4
Types ¶
type PubKey ¶
func DefaultPubKeys ¶
DefaultPubKeys returns the public key from $LIMA_HOME/_config/user.pub. The key will be created if it does not yet exist.
When loadDotSSH is true, ~/.ssh/*.pub will be appended to make the VM accessible without specifying an identity explicitly.