Thorsten Glaser
2021-Mar-24 02:13 UTC
"ssh-keygen -R hostname" errors out with non-existent known_hosts
On Tue, 23 Mar 2021, Noah Zalev wrote:> It may be a success according to your semantics in this instance, but > what about in cases where the known_host file *should* have been > found, but wasn't?What do you care? Its job is to ensure the next ssh to that host will not have an old host key in the way. If there?s no known_hosts file, that?s done. If you really need to test whether that file exists? test(1) exists. Don?t complicate things. bye, //mirabilos -- ?MyISAM tables -will- get corrupted eventually. This is a fact of life. ? ?mysql is about as much database as ms access? ? ?MSSQL at least descends from a database? ?it's a rebranded SyBase? ?MySQL however was born from a flatfile and went downhill from there? ? ?at least jetDB doesn?t claim to be a database? (#nosec) ??? Please let MySQL and MariaDB finally die!
Peter Moody
2021-Mar-24 02:42 UTC
"ssh-keygen -R hostname" errors out with non-existent known_hosts
> Its job is to ensure the next ssh to that host will not have an old > host key in the way. If there?s no known_hosts file, that?s done.one could make the same argument about umount; it's job is to make sure a particular device isn't mounted $ umount: /mnt/this-disk-does-not-exist: no mount point specified. umount: /mnt/this-disk-does-not-exist: no mount point specified. $ echo $? 32> If you really need to test whether that file exists? test(1) exists.and similarly someone could test(1) that ~/.ssh/known_hosts exists before calling ssh-keygen -R (which honestly seems like the easiest solution to the original problem) anyway, this is definitely in the realm of bikeshedding.
Damien Miller
2021-Mar-24 03:49 UTC
"ssh-keygen -R hostname" errors out with non-existent known_hosts
On Wed, 24 Mar 2021, Thorsten Glaser wrote:> On Tue, 23 Mar 2021, Noah Zalev wrote: > > > It may be a success according to your semantics in this instance, but > > what about in cases where the known_host file *should* have been > > found, but wasn't? > > What do you care?Because known_hosts not existing is an abnormal condition for a tool that is asked to modify known_hosts.