⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

A simple abstraction around ssh and sftp libraries in go.

License

Notifications You must be signed in to change notification settings

bvnarayan/simplessh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

simplessh

SimpleSSH is a simple wrapper around go ssh and sftp libraries.

License

SimpleSSH is licensed under the MIT license.

Installation

go get github.com/sfreiberg/simplessh

Documentation

GoDoc

Example

package main

import (
	"github.com/sfreiberg/simplessh"

	"fmt"
)

func main() {
	/*
		Leave privKeyPath empty to use $HOME/.ssh/id_rsa.
		If username is blank simplessh will attempt to use the current user.
	*/
	client, err := simplessh.ConnectWithKeyFile("localhost:22", "root", "/home/user/.ssh/id_rsa")
	if err != nil {
		panic(err)
	}
	defer client.Close()

	output, err := client.Exec("uptime")
	if err != nil {
		panic(err)
	}

	fmt.Printf("Uptime: %s\n", output)
}

About

A simple abstraction around ssh and sftp libraries in go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%