diff options
Diffstat (limited to 'ssh.go')
| -rw-r--r-- | ssh.go | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -5,23 +5,23 @@ import ( "io/ioutil" "time" - "golang.org/x/crypto/ssh" "github.com/tmc/scp" "go.wit.com/log" + "golang.org/x/crypto/ssh" ) var sshHostname string -var sshPort int -var sshUsername string -var sshPassword string -var sshKeyfile string +var sshPort int +var sshUsername string +var sshPassword string +var sshKeyfile string func SSHclientSet(hostname string, port int, username string, pass string, keyfile string) { - sshHostname = hostname - sshPort = port - sshUsername = username - sshPassword = pass - sshKeyfile = keyfile + sshHostname = hostname + sshPort = port + sshUsername = username + sshPassword = pass + sshKeyfile = keyfile } func SSHclientSCP(localfile string, remotefile string) { @@ -49,7 +49,7 @@ func mySsh(hostname string, port int, username string, pass string, keyfile stri // log.Log(SSH, "hostkey =", hostKey) publicKey, err := PublicKeyFile(keyfile) - if (err != nil) { + if err != nil { log.Log(SSH, "PublicKeyFile() error =", err) } @@ -75,7 +75,7 @@ func mySsh(hostname string, port int, username string, pass string, keyfile stri ssh.KeyAlgoED25519, }, // optional tcp connect timeout - Timeout: 5 * time.Second, + Timeout: 5 * time.Second, } sport := fmt.Sprintf("%d", port) |
