Skip to content
/ sshctl Public

Go client to control an SSH multiplexing master process

License

Notifications You must be signed in to change notification settings

mpfz0r/sshctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sshctl

A Go client library to control an SSH multiplexing master process.

Example

Start a regular ssh(1) command with a ControlMaster socket in /var/tmp/mux.sock:

$ ssh -fN -oControlMaster=yes -oControlPath=/var/tmp/mux.sock host

With sshctl you can run request additional SSH sessions from this socket:

import "github.com/mpfz0r/sshctl"

sess := sshctl.NewSession("/var/tmp/mux.sock")

var outb bytes.Buffer
sess.Stdout = &outb
err := sess.Run("cat /etc/motd")

if err != nil {
	fmt.Println("Got err: ", err)
} else {
	fmt.Println("Remote motd: ", outb.String())
}

About

Go client to control an SSH multiplexing master process

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages