ssh/example/upload/main.go

23 lines
495 B
Go

package main
import (
"blacktea.vip.cpolar.top/OrgGo/ssh"
)
func main() {
client, err := ssh.NewClient("localhost", "22", "root", "ubuntu")
if err != nil {
panic(err)
}
defer client.Close()
var remotedir = "/root/test/"
// upload dir
var local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/"
client.Upload(local, remotedir)
// upload file
local = "/home/ubuntu/go/src/blacktea.vip.cpolar.top/OrgGo/ssh/test/upload/file"
client.Upload(local, remotedir)
}