UPDATE-OPENSSH-KNOWN-HOSTS(8)

πŸ“¦
version 0.6.3 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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. See EXIT_IGNORE below πŸ‘‡

🌸 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 a sources subdirectory 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 in PLUGIN_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, p or y (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