Documentation
¶
Index ¶
- func Connect(addr string, conf *ssh.ClientConfig) (*ssh.Client, error)
- func CopyFile(client *ssh.Client, src, dst string) error
- func GetTermdata() (int, string, int, int, error)
- func MakeInteractive(session *ssh.Session) (func(), error)
- func MoveFile(client *ssh.Client, src, dst string) error
- func PullFile(client *ssh.Client, src, dst string) error
- func ReadFile(client *ssh.Client, path string) ([]byte, os.FileInfo, error)
- func RemoveFile(client *ssh.Client, path string) error
- func StartBufferedInteractiveShell(client *ssh.Client, stdout, stderr, stdin io.Writer) error
- func StartCommand(client *ssh.Client, command string) ([]byte, error)
- func StartInteractiveBufferedCommand(client *ssh.Client, command string, stdout, stderr, stdin io.Writer) error
- func StartInteractiveCommand(client *ssh.Client, command string) error
- func StartInteractiveShell(client *ssh.Client) error
- func WriteFile(client *ssh.Client, src []byte, dst string, fm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
Connect opens a new ssh client.
The difference to ssh.Dial is that every given auth method is tried individually till the connection is up or all have been tried.
func CopyFile ¶
CopyFile copies a file to the target via sftp. Does not check if file is present at dst, will overwrite.
func GetTermdata ¶
GetTermdata returns a set of values from the currently used terminal that is required to request a remote pty.
Returns the terminal file descriptor, terminal type (will fall back to xterm if none is found), window width and window height. Will error when no real terminal is attached.
func MakeInteractive ¶
MakeInteractive requests a PTY to be attached to the calling terminal. The returned function can be used to restore the Terminal to the previous state (alias for term.Restore)
func RemoveFile ¶
RemoveFile removes a file or (empty) directory via sftp.
func StartBufferedInteractiveShell ¶
StartBufferedInteractiveShell starts an interactive shell in its own pty on the given client. Writes the i/o streams to the given writers.
func StartCommand ¶
StartCommand starts the given command non-interactively on the given ssh session. This is pretty much equal to session.CombinedOutput()
func StartInteractiveBufferedCommand ¶
func StartInteractiveBufferedCommand(client *ssh.Client, command string, stdout, stderr, stdin io.Writer) error
StartInteractiveBufferedCommand starts a command in a pty on the given client. Writes the i/o streams to the given writers.
func StartInteractiveCommand ¶
StartInteractiveCommand starts a command in a pty on the given client.
func StartInteractiveShell ¶
StartInteractiveShell starts an interactive shell in its own pty on the given client.
Types ¶
This section is empty.