sshauto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package sshauto runs `ssh` inside a pseudo-terminal and auto-types a saved password the first time the remote asks for one, then hands the session over to the real terminal for fully interactive use. It exists so stool can auto-login with a saved password without depending on the external `sshpass` binary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Args     []string // ssh argv, e.g. from sshlaunch.Args
	Password string
	// contains filtered or unexported fields
}

Cmd implements tea.ExecCommand (Run/SetStdin/SetStdout/SetStderr), so it can be passed to tea.Exec the same way an *exec.Cmd is passed to tea.ExecProcess.

func (*Cmd) Run

func (c *Cmd) Run() error

Run starts ssh attached to a pty, types Password the first time the output contains a case-insensitive "password:" prompt, then proxies the real terminal's stdin/stdout to the pty for the rest of the session (so host-key prompts, interactive shells, etc. all work normally).

func (*Cmd) SetStderr

func (c *Cmd) SetStderr(w io.Writer)

func (*Cmd) SetStdin

func (c *Cmd) SetStdin(r io.Reader)

func (*Cmd) SetStdout

func (c *Cmd) SetStdout(w io.Writer)

Jump to

Keyboard shortcuts

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