sshx

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package sshx builds ssh invocations for stored hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectArgs

func ConnectArgs(h store.Host) ([]string, error)

ConnectArgs returns the full argv (excluding "ssh" itself) for an interactive login. If the host has a remote path, the session starts in it.

func DialSFTP

func DialSFTP(ctx context.Context, h store.Host) (*vfs.RemoteFS, error)

DialSFTP opens an SFTP session to h through the system ssh binary, so it uses the same ~/.ssh/config, agent, keys and jump hosts as connecting.

func Exec

func Exec(args []string) error

Exec replaces the current process with ssh. It only returns on error.

func Options

func Options(h store.Host) ([]string, error)

Options returns the ssh options for h (port, identity, jump host and extra args), without the destination.

func Quote

func Quote(s string) string

Quote quotes s for a POSIX shell. A leading "~/" is left unquoted so the remote shell still expands it.

func SFTPArgs

func SFTPArgs(h store.Host) ([]string, error)

SFTPArgs returns the ssh argv (excluding "ssh") that starts the sftp subsystem on h. BatchMode keeps ssh from prompting inside the TUI; auth must come from keys or an agent (1Password's agent prompts in its own window, which is fine).

func SplitArgs

func SplitArgs(s string) ([]string, error)

SplitArgs splits a string into arguments using POSIX-shell-like rules for whitespace, single quotes, double quotes and backslashes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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