JIHAD Posted October 2, 2014 Report Posted October 2, 2014 package mainimport ( "bytes" "fmt" "code.google.com/p/go.crypto/ssh" "os")func main() {config := &ssh.ClientConfig{ User: os.Args[3], Auth: []ssh.AuthMethod{ ssh.Password(os.Args[4]), },}client, err := ssh.Dial("tcp", os.Args[1] + ":" + os.Args[2], config)if err != nil { panic("Failed to dial: " + err.Error())}session, err := client.NewSession()if err != nil { panic("Failed to create session: " + err.Error())}defer session.Close()var b bytes.Buffersession.Stdout = &bif err := session.Run(os.Args[5]); err != nil { panic("Failed to run: " + err.Error())}fmt.Println(b.String())}compile and execute: ssh.exe ip port user password "command" Quote