sks(8)

πŸ’– NAME πŸ’–

okay so this is the manual for sks(8) β€” the SKS OpenPGP Key server, aka the Synchronizing Key Server bestie πŸ—οΈβœ¨


🌸 SYNOPSIS 🌸

sks [options] -debug

✨ DESCRIPTION ✨

SKS is an OpenPGP keyserver and its whole goal is to be easy to deploy, decentralized, and highly reliable at syncing. That means a key you submit to one SKS server gets distributed to all the key servers like, fast, and even the servers that are wildly out-of-date or have the spottiest connectivity ever can still fully synchronize with the rest of the system. no one gets left behind, periodt πŸ’…

The design of SKS is deliberately simple. The server is made of two single-threaded processes:

  • sks db β€” does the normal public-key-server jobs, like answering web requests. Its one special little talent is that it keeps a log summarizing the changes to the key database.
  • sks recon β€” does all the work of reconciling host databases. It keeps track of specialized summary information about the database, and it uses that info to efficiently figure out the differences between its own database and another host's. iykyk 🧠✨

πŸ¦‹ FEATURES πŸ¦‹

  • Highly efficient and reliable reconciliation algorithm 🌈
  • Follows RFC2440 and RFC2440bis carefully β€” and unlike PKS, SKS supports new and old style packets, photoID packets, multiple subkeys, and pretty much everything the RFCs allow. she read the docs fr fr πŸ“–
  • Fully compatible with the PKS system β€” can both send and receive syncs from PKS servers, so connectivity is seamless 🫢
  • Simple configuration: each host just needs a (partial) list of the other participating key servers. Gossip is used to distribute information without putting a heavy load on any one host πŸ‘‘
  • Supports HKP/web-based querying, and soon-to-be-standard machine readable indices ⭐

πŸ’… OPTIONS πŸ’…

The SKS binary command options are as follows:

  • db β€” initiates database server.
  • recon β€” initiates reconciliation server.
  • cleandb β€” apply filters to all keys in database, fixing some common problems.
  • build β€” build key database, including body of keys directly in database.
  • fastbuild -n [size] -cache [mbytes] β€” build key database, doesn't include keys directly in database, and it's faster than build. -n specifies the number of keydump files to read per pass when used with build, and the multiple of 15,000 keys to be read per pass when used with fastbuild. -cache specifies the database cache to use in megabytes.
  • pbuild -cache [mbytes] -ptree_cache [mbytes] β€” build prefix-tree database, used by reconciliation server, from key database. Lets you specify the cache for the key database and for the ptree database.
  • dump numkeys dumpdir <filename-prefix> β€” create a raw dump of the keys in the database. The dump is split into multiple files; the numkeys parameter determines the number of keys dumped in each file. The optional filename-prefix is prepended to the dump file names. Without it the dump files are named 0000.pgp, 0001.pgp,...
  • merge β€” adds key from key files to existing database.
  • drop β€” drops key from database.
  • update_subkeys [-n # of updates / 1000] β€” updates subkey keyid index to include all current keys. Only useful when upgrading versions 1.0.4 or before of SKS.
  • version β€” prints SKS version and linked version of Berkeley DB to stdout.
  • help β€” prints the help message.

πŸŽ€ ADDITIONAL OPTIONS πŸŽ€

ngl you won't need most of the options below for normal operation. These options can be given in basedir/sksconf or as a command line option for the sks binary.

  • -debug β€” debugging mode.
  • -debuglevel β€” debugging level β€” sets verbosity of logging.
  • -q β€” number of bits defining a bin.
  • -mbar β€” number of errors that can be corrected in one shot.
  • -seed β€” seed used by RNG.
  • -hostname β€” current hostname.
  • -nodename β€” current nodename.
  • -d β€” number of keys to drop at random when synchronizing.
  • -n β€” number of keydump files to load at once.
  • -max_internal_matches β€” maximum number of matches for most specific word in a multi-word search.
  • -max_matches β€” maximum number of matches that will be returned from a query.
  • -max_uid_fetches β€” maximum number of uid fetches performed in a verbose index query.
  • -pagesize β€” pagesize in 512 byte chucks for key db.
  • -keyid_pagesize β€” pagesize in 512 byte chucks for keyid db.
  • -meta_pagesize β€” pagesize in 512 byte chucks for metadata db.
  • -subkeyid_pagesize β€” pagesize in 512 byte chucks for subkeyid db.
  • -time_pagesize β€” pagesize in 512 byte chucks for time db.
  • -tqueue_pagesize β€” pagesize in 512 byte chucks for tqueue db.
  • -word_pagesize β€” pagesize in 512 byte chunks for word db.
  • -cache β€” cache size in megs for key db.
  • -ptree_pagesize β€” pagesize in 512 byte chunks for prefix tree db.
  • -ptree_cache β€” cache size in megs for prefix tree db.
  • -baseport β€” set base port number.
  • -recon_port β€” set recon port number.
  • -recon_address β€” set recon binding addresses. Can be a list of whitespace separated IP addresses or domain names.
  • -hkp_port β€” set hkp port number.
  • -hkp_address β€” set hkp binding addresses. Can be a list of whitespace separated IP addresses or domain names.
  • -use_port_80 β€” have the HKP interface listen on port 80, as well as the hkp_port.
  • -basedir β€” set base directory.
  • -stdoutlog β€” send log messages to stdout instead of log file.
  • -diskptree β€” use a disk-based ptree implementation. Slower, but requires far less memory.
  • -nodiskptree β€” use in-mem ptree.
  • -max_ptree_nodes β€” maximum number of allowed ptree nodes. Only meaningful if -diskptree is set.
  • -prob β€” set probability. Used for testing code only.
  • -recon_sync_interval β€” set sync interval for reconserver.
  • -gossip_interval β€” set time between gossips in minutes.
  • -dontgossip β€” don't gossip automatically. Host will still respond to requests from other hosts.
  • -db_sync_interval β€” set sync interval for dbserver.
  • -checkpoint_interval β€” time period between checkpoints.
  • -recon_checkpoint_interval β€” time period between checkpoints for reconserver.
  • -ptree_thresh_mult β€” multiple of thresh which specifies minimum node size in prefix tree.
  • -recon_thresh_mult β€” multiple of thresh which specifies minimum node size that is included in reconciliation.
  • -max_recover β€” maximum number of differences to recover in one round.
  • -http_fetch_size β€” number of keys for reconserver to fetch from dbserver in one go.
  • -wserver_timeout β€” timeout in seconds for webserver requests.
  • -reconciliation_timeout β€” timeout for reconciliation runs in minutes.
  • -stat_hour β€” hour at which to run database statistics.
  • -initial_stat β€” runs database statistics calculation on boot.
  • -reconciliation_config_timeout β€” set timeout in seconds for initial exchange of config info in reconciliation.
  • -missing_keys_timeout β€” timeout in seconds for get_missing_keys.
  • -command_timeout β€” timeout in seconds for commands set over command socket.
  • -sendmail_cmd β€” command used for sending mail.
  • -from_addr β€” from address used in synchronization emails used to communicate with PKS.
  • -dump_new_only β€” when doing a database dump, only dump new keys, not keys already contained in a keydump file.
  • -max_outstanding_recon_requests β€” maximum number of outstanding requests in reconciliation.
  • -membership_reload_interval β€” maximum interval (in hours) at which membership file is reloaded.
  • -disable_mailsync β€” disable sending of PKS mailsync messages. ONLY FOR STANDALONE SERVERS! THIS IS THE MECHANIASM FOR SENDING UPDATES TO NON-SKS SERVERS.
  • -disable_log_diffs β€” disable logging of recent hashset diffs.
  • -server_contact β€” set OpenPGP KeyID of the server contact.

and then the last two get squished together in the original page, so here's the raw tea exactly as it appears:

  • --help, -help
  • -stdin β€” Read keyids from stdin (sksclient only)

Displays list of options.


🧚 FILES 🧚

info about the important files living in your SKS basedir:

  • bin/sks β€” the main SKS executable.
  • bin/sks_add_mail β€” the executable responsible for parsing incoming mails from PKS key servers.
  • bin/sks_build.sh β€” script to generate an initial database.
  • mailsync β€” the mailsync should contains a list of email addresses of PKS keyservers. This file is important, because it ensures that keys submitted directly to an SKS keyserver are also forwarded to PKS keyservers. IMPORTANT : don't add someone to your mailsync file without getting their permission first! πŸ™ˆ (fr fr, ask first)
  • membership β€” with SKS, two hosts can efficiently compare their databases then repair whatever differences are found. In order to set up reconciliation, you first need to find other SKS servers that will agree to gossip with you. The hostname and port of the server that has agreed to do so should be added to this file.
  • sksconf β€” the configuration file for your SKS server.

🌈 EXAMPLES 🌈

membership

keyserver.ahost.org 11370 # Comments are allowed
keyserver.foo.org 11370   # Another host with default ports

sksconf

membership_reload_interval: 1
initial_stat:
hostname: keyserver.example.com
from_addr: pgp-public-keys@keyserver.example.com

Procmail

PATH=/path/of/sks/exectuables
:0
* ^Subject: incremental
| /path/of/sks_add_mail /path/to/sks/directory

/etc/aliases

pgp-public-keys:      "|/path/of/sks_add_mail /path/to/sks/directory"

πŸ‘‘ SEE ALSO πŸ‘‘

The SKS website is located at https://github.com/SKS-Keyserver/sks-keyserver.


πŸ’œ AUTHOR πŸ’œ

The first draft was written by Thomas Sjogren <thomas@northernsecurity.net>.


and that's the whole page bestie 🫢 this manual is version 0.1 and it's dated 2024-07-07, so go forth, sync those keys, and stay iconic πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from