Skip to content

Commit 4feb708

Browse files
committed
SSH: Set UserKnownHostsFile to /dev/null
As we are dealing with temporary SSH host keys, we should not pollute the users's known hosts file with ephermeral data. Additionally, this avoids issues where the user has an invalid known hosts file, as in rancher-sandbox/rancher-desktop#504. Signed-off-by: Mark Yen <[email protected]>
1 parent 663023f commit 4feb708

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/sshutil/sshutil.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ func CommonArgs(useDotSSH bool) ([]string, error) {
155155

156156
args = append(args,
157157
"-o", "StrictHostKeyChecking=no",
158+
"-o", "UserKnownHostsFile=/dev/null",
158159
"-o", "NoHostAuthenticationForLocalhost=yes",
159160
"-o", "GSSAPIAuthentication=no",
160161
"-o", "PreferredAuthentications=publickey",

0 commit comments

Comments
 (0)