diff options
| author | Jeff Carr <[email protected]> | 2024-01-25 00:39:14 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-25 00:39:14 -0600 |
| commit | 41fe4a4659d50d70a835224405490588019d24ff (patch) | |
| tree | dd6677fb17d11a4233568fddf0d3a141434bba10 /ssh.go | |
| parent | e24c2c2eb3feb5083a74a9b2cb396bcbcb0ac52d (diff) | |
new homev0.13.0
Signed-off-by: Jeff Carr <[email protected]>
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) |
