Closed justone closed 1 year ago
Two quick comments:
-d
flag we can do until we need a global -d
flag, so no problem there/dev/null
we should use the Golang provided os.DevNull
so that we stay compatible across platforms.More generally, I am wondering if doing that we could hide and change the behavior of the SSH doing the connection. Because with the flag -d
we just say that we disable the strict host key check (-o StrictHostKeyChecking
) as per SSH spec, and nothing would indicate here that we redirect the warning to '/dev/null', which is done with -o GlobalKnownHostsFile
and -o UserKnownHostsFile
.
Therefore shouldn't we add another new flag (with a short version) like --ignore-warning
or --ignore-khosts
so that we specify the full behaviour wanted as for instance:
awless ssh myinstance ---ignore-khosts -d
Very good point. I like the idea of separating the flag out. I'll update the PR.
Without this change, when the host key changes, you still get a big scary warning, even though the ssh connection succeeds. This just
/dev/null
s the known hosts file so that nothing is shown.Also, it adds a short option (
-d
) for skipping the host key check.