Using ssh-keygen -R to remove a key from a file with group/other read permission changes the permissions to remove any group and other bits. This is good for ~/.ssh/known_hosts, which should be 600, but bad for /etc/ssh/ssh_known_hosts, which should be 644. Inspecting the source, the function that removes a key sets umask 077 before creating the new file for the existing lines (except the one to be removed), but doesn't copy the permissions.
Created attachment 3392 [details] preserve file mode This preserves world and group readability when deleting or hashing known_hosts files.
This has been committed and will be in OpenSSH 8.4 - thanks!
Thank you for fixing this!
close bugs that were resolved in OpenSSH 8.5 release cycle