mirror of
https://github.com/kemko/xc.git
synced 2026-01-01 15:55:43 +03:00
26 lines
484 B
Go
26 lines
484 B
Go
package remote
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
var (
|
|
sshOptions = map[string]string{
|
|
"PasswordAuthentication": "no",
|
|
"PubkeyAuthentication": "yes",
|
|
"StrictHostKeyChecking": "no",
|
|
"TCPKeepAlive": "yes",
|
|
"ServerAliveCountMax": "12",
|
|
"ServerAliveInterval": "5",
|
|
}
|
|
)
|
|
|
|
func sshOpts() (params []string) {
|
|
params = make([]string, 0)
|
|
for opt, value := range sshOptions {
|
|
option := fmt.Sprintf("%s=%s", opt, value)
|
|
params = append(params, "-o", option)
|
|
}
|
|
return
|
|
}
|