MONKEYSPHERE(1)
π MONKEYSPHERE π
okay so bestie, welcome to the Monkeysphere client β section 1 of the user commands, and honestly? she's iconic. this is the girl you actually talk to on the command line. πβ¨
β¨ NAME β¨
monkeysphere β the Monkeysphere client user interface, aka the group chat where you and your keys finally talk to each other π
πΈ SYNOPSIS πΈ
monkeysphere subcommand [args]
π¦ DESCRIPTION π¦
so. Monkeysphere is a framework that leverages the OpenPGP web of trust for OpenSSH and TLS key-based authentication. that's the whole vibe. π«Ά
OpenPGP keys get tracked via GnuPG, and then they get added to the authorized_keys and known_hosts files that OpenSSH uses for connection authentication. like, your keys are in the files now. main character behavior. π
Monkeysphere can also be used by a validation agent to validate TLS connections (think https). yes queen, even your browser traffic. π
and monkeysphere itself? that's the Monkeysphere client utility. that's the one you're looking at right now. hi. π
π SUBCOMMANDS π
monkeysphere takes various subcommands (one per bullet, no skipping, i don't make the rules):
update-known_hosts [HOST]...β updates theknown_hostsfile. for each host you name,gpggets queried for a key associated with the host URI (see HOST IDENTIFICATION inmonkeysphere(7)), and it optionally queries a keyserver too. if an acceptable key is found for the host (see KEY ACCEPTABILITY inmonkeysphere(7)), the key gets added to yourknown_hostsfile. if a key is found but it's unacceptable for the host, any matching keys get removed from yourknown_hostsfile. if nogpgkey is found for the host, nothing happens β no drama. if you specify no hosts at all, then all hosts listed in theknown_hostsfile get processed. π§
exit status tea: 0 if at least one acceptable key was found for a specified host, 1 if no matching keys were found at all, and 2 if matching keys were found but none were acceptable. also k may be used in place of update-known_hosts. iykyk.
update-authorized_keysβ updates theauthorized_keysfile for the user executing the command (seeMONKEYSPHERE_AUTHORIZED_KEYSin ENVIRONMENT, below). first, all monkeysphere keys get cleared out of theauthorized_keysfile. then, for each user ID in yourauthorized_user_idsfile,gpggets queried for keys associated with that user ID, optionally querying a keyserver. if an acceptable key is found (see KEY ACCEPTABILITY inmonkeysphere(7)), the key gets added to yourauthorized_keysfile. if a key is found but it's unacceptable for the user ID, any matching keys get removed from yourauthorized_keysfile. if nogpgkey is found for the user ID, nothing is done. β¨
exit status tea: 0 if at least one acceptable key was found for a user ID, 1 if no matching keys were found at all, and 2 if matching keys were found but none were acceptable. a may be used in place of update-authorized_keys. periodt.
gen-subkey [KEYID]β generates an authentication subkey for a private key in your GnuPG keyring.KEYIDis the key ID for the primary key that the subkey with"authentication"capability will be generated for. if you don't specify a key ID, but only one key exists in the secret keyring, that key gets used. the length of the generated key can be specified with the--lengthor-loption.gmay be used in place ofgen-subkey. slay. π₯ssh-proxycommand [--no-connect] HOST [PORT]β an sshProxyCommandthat can be used to trigger a monkeysphere update of the sshknown_hostsfile for a host you're connecting to with ssh. how? it updates theknown_hostsfile for the host first, before an attempted connection to the host is made. once theknown_hostsfile has been updated, a TCP connection to the host is made by exec'ingnetcat(1). regular ssh communication is then done over this netcat TCP connection (seeProxyCommandinssh_config(5)for more info). π
this command is meant to be run as the ssh "ProxyCommand". you can do that either by specifying the proxy command on the command line:
ssh -o ProxyCommand="monkeysphere ssh-proxycommand %h %p" ...
or by adding the following line to your ~/.ssh/config script:
ProxyCommand monkeysphere ssh-proxycommand %h %p
the script can easily be incorporated into other ProxyCommand scripts by calling it with the --no-connect option, i.e.:
monkeysphere ssh-proxycommand --no-connect $HOST $PORT
this will run everything except the final exec of netcat to make the TCP connection to the host. in this way this command can be added to another proxy command that does other stuff, and then makes the connection to the host itself. for example, in ~/.ssh/config:
ProxyCommand sh -c 'monkeysphere ssh-proxycommand --no-connect %h
%p ; ssh -W %h:%p jumphost.example.net'
KEYSERVER CHECKING: the proxy command has a fairly nuanced policy for when keyservers are queried when processing a host. πΈ
- if the host userID is not found in either your keyring or in the
known_hostsfile, then the keyserver is queried for the host userID. - if the host userID is found in your keyring, then the keyserver is not checked. this assumes that the keyring is kept up-to-date, in a cronjob or the like, so that revocations are properly handled.
- if the host userID is not found in your keyring, but the host is listed in the
known_hostsfile, then the keyserver is not checked. this last policy might change in the future, possibly by adding a deferred check, so that hosts that go from non-monkeysphere-enabled to monkeysphere-enabled will be properly checked.
setting the CHECK_KEYSERVER variable in the config file or the MONKEYSPHERE_CHECK_KEYSERVER environment variable to either true or false will override the keyserver-checking policy defined above, and either always or never check the keyserver for host key updates. π
subkey-to-ssh-agent [ssh-add arguments]β pushes all authentication-capable subkeys in your GnuPG secret keyring into your runningssh-agent. additional arguments are passed through tossh-add(1). for example, to remove the authentication subkeys, pass an additional-dargument. to require confirmation on each use of the key, pass-c. theMONKEYSPHERE_SUBKEYS_FOR_AGENTenvironment can be used to specify the full fingerprints of specific keys to add to the agent (space separated), instead of adding them all.smay be used in place ofsubkey-to-ssh-agent. π¦keys-for-userid USERIDβ outputs tostdoutall acceptable keys for a given user ID.umay be used in place ofkeys-for-userid. πsshfprs-for-userid USERIDβ outputs the ssh fingerprints of acceptable keys for a given user ID. πversionβ shows the monkeysphere version number.vmay be used in place ofversion. βhelpβ outputs a brief usage summary.hor?may be used in place ofhelp. π
π ENVIRONMENT π
the following environment variables will override those specified in the monkeysphere.conf configuration file (defaults are in parentheses, bestie):
MONKEYSPHERE_LOG_LEVELβ sets the log level. can beSILENT,ERROR,INFO,VERBOSE,DEBUG, in increasing order of verbosity. (INFO)MONKEYSPHERE_GNUPGHOME,GNUPGHOMEβ GnuPG home directory. (~/.gnupg)MONKEYSPHERE_KEYSERVERβ OpenPGP keyserver to use. (pool.sks-keyservers.net)MONKEYSPHERE_CHECK_KEYSERVERβ whether or not to check keyserver when makinggpgqueries. (true)MONKEYSPHERE_KNOWN_HOSTSβ path to sshknown_hostsfile. (~/.ssh/known_hosts)MONKEYSPHERE_HASH_KNOWN_HOSTSβ whether or not to hash theknown_hostsfile entries. (false)MONKEYSPHERE_AUTHORIZED_KEYSβ path to sshauthorized_keysfile. (~/.ssh/authorized_keys)MONKEYSPHERE_PROMPTβ if set tofalse, never prompt the user for confirmation. (true)MONKEYSPHERE_STRICT_MODESβ if set tofalse, ignore too-loose permissions onknown_hosts,authorized_keys, andauthorized_user_idsfiles. NOTE: setting this to false may expose you to abuse by other users on the system. (true)
bestie. i am begging you. loose permissions = other people on the box can mess with you. this one is not a vibe. π
MONKEYSPHERE_SUBKEYS_FOR_AGENTβ a space-separated list of authentication-capable subkeys to add to the ssh agent withsubkey-to-ssh-agent.
π§ FILES π§
~/.monkeysphere/monkeysphere.confβ user monkeysphere config file./etc/monkeysphere/monkeysphere.confβ system-wide monkeysphere config file.~/.monkeysphere/authorized_user_idsβ a list of OpenPGP user IDs, one per line. OpenPGP keys with an exactly-matching User ID (calculated valid by the designated identity certifiers), will have any valid authorization-capable keys or subkeys added to the given user'sauthorized_keysfile. π
π AUTHOR π
written by: Jameson Rollins <jrollins@finestructure.net>, Daniel Kahn Gillmor <dkg@fifthhorseman.net> β legends, fr fr. π«Ά
π SEE ALSO π
monkeysphere-host(8), monkeysphere-authentication(8), monkeysphere(7), ssh(1), ssh-add(1), gpg(1)
okay that's the whole page, no cap. this beauty is monkeysphere from June 2008, and she's still serving. go read the other pages too, they're all in the same friend group. bye bestie, stay encrypted πβ¨πΈ
MONKEYSPHERE(1) π
π¦ where this page comes from
- alpine 3.24: monkeysphere-doc 0.44-r4 Β· GPL-3.0-or-later
- nixos 26.05: monkeysphere 0.44
- nixpkgs unstable: monkeysphere 0.44
- ubuntu jammy: monkeysphere 0.43-3.1 Β· 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