Skip to content

An implementation of SSH controlmaster support for Golang

License

Notifications You must be signed in to change notification settings

bored-engineer/controlmaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

controlmaster

GoDoc

An implementation of the OpenSSH ControlMaster protocol for Golang

NOTE: this relies on a fork of golang.org/x/crypto/ssh with support for custom transports (github.com/bored-engineer/ssh)

usage

package main

import (
	"log"

	"github.com/bored-engineer/controlmaster"
)

func main() {
	client, err := controlmaster.Dial("unix", "PATH_TO_CONTROLMASTER")
	if err != nil {
		log.Fatal(err)
	}
	session, err := client.NewSession()
	if err != nil {
		log.Fatal(err)
	}
	defer session.Close()
	out, err := session.CombinedOutput("id")
	if err != nil {
		log.Fatal(err)
	}
	log.Println(string(out))
}

About

An implementation of SSH controlmaster support for Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages