-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSH: Set UserKnownHostsFile to /dev/null #165
Conversation
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]>
@@ -155,6 +155,7 @@ func CommonArgs(useDotSSH bool) ([]string, error) { | |||
|
|||
args = append(args, | |||
"-o", "StrictHostKeyChecking=no", | |||
"-o", "UserKnownHostsFile=/dev/null", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we now want to remove RemoveKnownHostEntries() in L101?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we now want to remove RemoveKnownHostEntries() in L101?
Yes, that function should not be needed anymore if we don't use a known hosts file.
@mook-as can you update the PR to include removal of RemoveKnownHostEntries()
(and the call location, of course)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching that! Fixed in 08d4bc3
We no longer attempt to touch the known_hosts file. Signed-off-by: Mark Yen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM if CI green
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
As we are dealing with temporary SSH host keys, we should not pollute the users's known hosts file with ephemeral data. Additionally, this avoids issues where the user has an invalid known hosts file, as in rancher-sandbox/rancher-desktop#504.