Skip to content
This repository has been archived by the owner on Sep 9, 2022. It is now read-only.

Latest commit

 

History

History
41 lines (28 loc) · 1001 Bytes

README.md

File metadata and controls

41 lines (28 loc) · 1001 Bytes

SSH Client Script

FOSSA Status

SSH Shell with Go Programming

Install

    go get github.com/kevsersrca/secureshell

Usage

    package main

    import(
        s"github.com/kevsersrca/secureshell"
    )
    func main() {
            client, err := s.ConnectWithKeyFile("localhost:22", "root", "/home/user/.ssh/id_rsa")
        	if err != nil {
        		panic(err)
        	}
        	defer client.Close()
        
        	output, err := client.Exec("uptime -p")
        	if err != nil {
        		panic(err)
        	}
        	fmt.Println(output)
    }

License

FOSSA Status