Skip to content

Commit 7890e8d

Browse files
authored
Merge pull request docker-archive-public#4451 from krufab/bugfix/ISSUE-4450-use-ssh-serveraliveinterval
ISSUE-4450 Added ServerAliveInterval among the default ssh options
2 parents 0331899 + 8380765 commit 7890e8d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libmachine/ssh/client.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ const (
6868
var (
6969
baseSSHArgs = []string{
7070
"-F", "/dev/null",
71-
"-o", "PasswordAuthentication=no",
72-
"-o", "StrictHostKeyChecking=no",
73-
"-o", "UserKnownHostsFile=/dev/null",
74-
"-o", "LogLevel=quiet", // suppress "Warning: Permanently added '[localhost]:2022' (ECDSA) to the list of known hosts."
7571
"-o", "ConnectionAttempts=3", // retry 3 times if SSH connection fails
7672
"-o", "ConnectTimeout=10", // timeout after 10 seconds
7773
"-o", "ControlMaster=no", // disable ssh multiplexing
7874
"-o", "ControlPath=none",
75+
"-o", "LogLevel=quiet", // suppress "Warning: Permanently added '[localhost]:2022' (ECDSA) to the list of known hosts."
76+
"-o", "PasswordAuthentication=no",
77+
"-o", "ServerAliveInterval=60", // prevents connection to be dropped if command takes too long
78+
"-o", "StrictHostKeyChecking=no",
79+
"-o", "UserKnownHostsFile=/dev/null",
7980
}
8081
defaultClientType = External
8182
)

0 commit comments

Comments
 (0)