See http://superuser.com/a/141352/457084 - it is reasonably common to disable adding to known_hosts (sometimes I know a host just won't be around next time), but it currently outputs 'Warning: Permanently added '104.131.139.183' (RSA) to the list of known hosts' even when that isn't happening. I'm noting this upstream in the interest of correct output.
Well ssh *is* actually writing it, but it's being immediately discarded outside of ssh's control. You can already suppress the warning with LogLevel=ERROR as noted in those links and UserKnownHostsFile=/dev/null is a pretty poor practice anyway, so I don't think we should be doing anything to encourage it.
I see what you mean, and it is true that various workarounds are suggested at http://superuser.com/questions/141344/dont-add-hostkey-to-known-hosts-for-ssh/141352#141352. In terms of what ssh is writing, I would image that ssh can figure out whether the final output is /dev/null (of course the last thing most people want is yet another optional switch). In my case I like being able to have a known_hosts file that has hosts that I expect to connect to more than once - it feels more organized. In my case, I'm sometimes starting up temporary DigitalOcean droplets for a little while to test something out and then destroying them. I'd rather not limit my logging or have to mess around with a config file when I do that. Is there a way to do this which doesn't require tweaking the config files but isn't a poor practice?
Created attachment 2653 [details] Accept UserKnownHostsFile=none We could perhaps allow UserKnownHostsFile=none like this diff attempts
Looks like "UserKnownHostsFile none" was added back in 8.5 however it's not currently documented. We'll add this for the next release, which should fully resolve this bug.
OpenSSH 9.3 has been released. Close resolved bugs