UPDATE-OPENSSH-KNOWN-HOSTS(8)
π NAME π
update-openssh-knwon-hosts β download, filter and merge known_hosts for OpenSSH.
(yes bestie, "knwon" is literally how it's spelled up in here, that's canon, i don't make the rules π)
β¨ SYNOPSIS β¨
update-openssh-known-hosts [-f]
π¦ DESCRIPTION π¦
Okay so update-openssh-known-hosts is literally the girlboss that handles the whole pipeline for you: it manages the downloading, the filtering and the merging of ssh_known_hosts files β from anywhere β into one single local file, so that ssh(1) can just vibe with it. One file, no chaos, periodt. π
π OPTIONS π
-fβ treat every non-zero exit from a download plugin as an error. SeeEXIT_IGNOREbelow π
πΈ RETURN VALUES πΈ
Returns zero on success, and literally anything else on error. That's it, that's the vibe check. β¨
π ENVIRONMENT π
CONFDIRβ the configuration directory. Defaults to/etc/openssh-known-hosts. Currently there's only asourcessubdirectory hanging out in there.PLUGIN_PATHβ the plugin search path. Defaults to/usr/local/share/openssh-known-hosts/plugins:/usr/share/openssh-known-hosts/plugins.CACHEDIRβ the cache directory. Defaults to/var/cache/openssh-known-hosts.LOCKβ the lockfile path. Defaults to/var/lock/openssh-known-hosts.OUTFILEβ the output file name. Defaults to/var/lib/openssh-known-hosts/ssh_known_hosts
π SOURCE DEFINITIONS π
A source definition is a lil shell snippet you drop into CONFDIR/sources/, and it needs a name that's run-parts(8) compliant. Fr fr, that part matters. π«Ά
There are two variables in there that aren't specific to any download plugin:
PLUGINβ the name of the download plugin to use. It gets searched for inPLUGIN_PATH.EXIT_IGNOREβ optional, space-separated list of exit codes that should be ignored. If a plugin exits with one of those, the previously downloaded version gets used instead. Iconic, honestly. π
π DOWNLOAD PLUGINS π
Download plugins are executables that you drop into PLUGIN_PATH, and you reference them via the PLUGIN variable inside the source definition. π§
A plugin gets the variables set in the source definition, handed to it in its environment. The working directory gets set to the source's cache directory. Literally all a plugin has to do is create a file named new. π
current must not be touched β hands off, bestie β but it can be used as a hint to skip downloading the exact same file all over again.
stdout and stderr get connected to log, which will be output on error. And ngl, plugins don't even need to create new if it would end up identical to current. Efficient queen behaviour. β¨
π HOSTNAME FILTERS π
Place a file foo.filter right next to your source definition foo. π
Each line should contain a rule β that's an action, a space, and a pattern. The first rule with a matching pattern decides everything:
- if the action starts with
a,o,pory(for accept, admit, allow, ok, pass, permit, print, yes, ...) then the hostname gets used β - otherwise it's discarded ποΈ
And if a key ends up with no hostnames left, it gets discarded as a whole. No half-keys, no crumbs. π
β SEE ALSO β
ssh(1), sshd(8), ssh_config(5), curl(1), rsync(1), psql(1), run-parts(8)
πΈ AUTHORS πΈ
Timo WeingΓ€rtner <timo@tiwe.de>
And that's the whole page, bestie β this one's from 2014-02-03, part of the UPDATE-OPENSSH-KNOWN-HOSTS(8) manual, mwah π no cap, go forth and merge your known_hosts πβ¨
π¦ where this page comes from
- debian trixie: openssh-known-hosts 0.6.3-1 Β· GPL-3.0-or-later
- ubuntu questing: openssh-known-hosts 0.6.3-1
- ubuntu resolute: openssh-known-hosts 0.6.3-1build1 Β· GPL-3.0-or-later
- ubuntu stonking: openssh-known-hosts 0.6.3-1build1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms