3 # monkeysphere-server: MonkeySphere server admin tool
5 # The monkeysphere scripts are written by:
6 # Jameson Rollins <jrollins@fifthhorseman.net>
7 # Daniel Kahn Gillmor <dkg@fifthhorseman.net>
9 # They are Copyright 2008, and are all released under the GPL, version 3
12 ########################################################################
15 SHARE=${MONKEYSPHERE_SHARE:="/usr/share/monkeysphere"}
17 . "${SHARE}/common" || exit 1
19 VARLIB="/var/lib/monkeysphere"
22 # date in UTF format if needed
23 DATE=$(date -u '+%FT%T')
25 # unset some environment variables that could screw things up
31 ########################################################################
33 ########################################################################
37 usage: $PGRM <subcommand> [options] [args]
38 MonkeySphere server admin tool.
41 update-users (u) [USER]... update user authorized_keys files
43 gen-key (g) [NAME[:PORT]] generate gpg key for the server
44 --length (-l) BITS key length in bits (2048)
45 --expire (-e) EXPIRE date to expire
46 --revoker (-r) FINGERPRINT add a revoker
47 extend-key (e) EXPIRE extend expiration to EXPIRE
48 add-hostname (n+) NAME[:PORT] add hostname user ID to server key
49 revoke-hostname (n-) NAME[:PORT] revoke hostname user ID
50 show-key (s) output all server host key information
51 publish-key (p) publish server host key to keyserver
52 diagnostics (d) report on server monkeysphere status
54 add-id-certifier (c+) KEYID import and tsign a certification key
55 --domain (-n) DOMAIN limit ID certifications to DOMAIN
56 --trust (-t) TRUST trust level of certifier (full)
57 --depth (-d) DEPTH trust depth for certifier (1)
58 remove-id-certifier (c-) KEYID remove a certification key
59 list-id-certifiers (c) list certification keys
61 gpg-authentication-cmd CMD gnupg-authentication command
68 su_monkeysphere_user() {
69 su --preserve-environment "$MONKEYSPHERE_USER" -- -c "$@"
72 # function to interact with the host gnupg keyring
76 GNUPGHOME="$GNUPGHOME_HOST"
79 # NOTE: we supress this warning because we need the monkeysphere
80 # user to be able to read the host pubring. we realize this might
81 # be problematic, but it's the simplest solution, without too much
83 gpg --no-permission-warning "$@"
86 # always reset the permissions on the host pubring so that the
87 # monkeysphere user can read the trust signatures
88 chgrp "$MONKEYSPHERE_USER" "${GNUPGHOME_HOST}/pubring.gpg"
89 chmod g+r "${GNUPGHOME_HOST}/pubring.gpg"
94 # function to interact with the authentication gnupg keyring
95 # FIXME: this function requires basically accepts only a single
96 # argument because of problems with quote expansion. this needs to be
98 gpg_authentication() {
99 GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
102 su_monkeysphere_user "gpg $@"
105 # output just key fingerprint
106 fingerprint_server_key() {
107 gpg_host --list-secret-keys --fingerprint \
108 --with-colons --fixed-list-mode 2> /dev/null | \
109 grep '^fpr:' | head -1 | cut -d: -f10
112 # output key information
117 fingerprint=$(fingerprint_server_key)
118 gpg_authentication "--fingerprint --list-key $fingerprint"
120 # dumping to a file named ' ' so that the ssh-keygen output
121 # doesn't claim any potentially bogus hostname(s):
123 gpg_authentication "--export $fingerprint" | openpgp2ssh "$fingerprint" 2>/dev/null > "$tmpkey/ "
124 echo -n "ssh fingerprint: "
125 (cd "$tmpkey" && ssh-keygen -l -f ' ')
127 echo -n "OpenPGP fingerprint: "
131 # update authorized_keys for users
134 # get users from command line
137 # or just look at all users if none specified
138 unames=$(getent passwd | cut -d: -f1)
142 MODE="authorized_keys"
145 GNUPGHOME="$GNUPGHOME_AUTHENTICATION"
147 # check to see if the gpg trust database has been initialized
148 if [ ! -s "${GNUPGHOME}/trustdb.gpg" ] ; then
149 failure "GNUPG trust database uninitialized. Please see MONKEYSPHERE-SERVER(8)."
152 # make sure the authorized_keys directory exists
153 mkdir -p "${VARLIB}/authorized_keys"
156 for uname in $unames ; do
157 # check all specified users exist
158 if ! getent passwd "$uname" >/dev/null ; then
159 log "----- unknown user '$uname' -----"
163 # set authorized_user_ids and raw authorized_keys variables,
164 # translating ssh-style path variables
165 authorizedUserIDs=$(translate_ssh_variables "$uname" "$AUTHORIZED_USER_IDS")
166 rawAuthorizedKeys=$(translate_ssh_variables "$uname" "$RAW_AUTHORIZED_KEYS")
168 # if neither is found, skip user
169 if [ ! -s "$authorizedUserIDs" ] ; then
170 if [ "$rawAuthorizedKeys" = '-' -o ! -s "$rawAuthorizedKeys" ] ; then
175 log "----- user: $uname -----"
177 # exit if the authorized_user_ids file is empty
178 if ! check_key_file_permissions "$uname" "$AUTHORIZED_USER_IDS" ; then
179 log "Improper permissions on authorized_user_ids file path."
183 # check permissions on the authorized_keys file path
184 if ! check_key_file_permissions "$uname" "$RAW_AUTHORIZED_KEYS" ; then
185 log "Improper permissions on authorized_keys file path path."
189 # make temporary directory
192 # trap to delete temporary directory on exit
193 trap "rm -rf $TMPDIR" EXIT
195 # create temporary authorized_user_ids file
196 TMP_AUTHORIZED_USER_IDS="${TMPDIR}/authorized_user_ids"
197 touch "$TMP_AUTHORIZED_USER_IDS"
199 # create temporary authorized_keys file
200 AUTHORIZED_KEYS="${TMPDIR}/authorized_keys"
201 touch "$AUTHORIZED_KEYS"
203 # set restrictive permissions on the temporary files
204 # FIXME: is there a better way to do this?
206 chmod 0600 "$AUTHORIZED_KEYS"
207 chmod 0600 "$TMP_AUTHORIZED_USER_IDS"
208 chown -R "$MONKEYSPHERE_USER" "$TMPDIR"
210 # if the authorized_user_ids file exists...
211 if [ -s "$authorizedUserIDs" ] ; then
212 # copy user authorized_user_ids file to temporary
214 cat "$authorizedUserIDs" > "$TMP_AUTHORIZED_USER_IDS"
216 # export needed variables
217 export AUTHORIZED_KEYS
218 export TMP_AUTHORIZED_USER_IDS
220 # process authorized_user_ids file, as monkeysphere
222 su_monkeysphere_user \
223 ". ${SHARE}/common; process_authorized_user_ids $TMP_AUTHORIZED_USER_IDS"
227 # add user-controlled authorized_keys file path if specified
228 if [ "$rawAuthorizedKeys" != '-' -a -s "$rawAuthorizedKeys" ] ; then
229 log -n "adding raw authorized_keys file... "
230 cat "$rawAuthorizedKeys" >> "$AUTHORIZED_KEYS"
234 # openssh appears to check the contents of the
235 # authorized_keys file as the user in question, so the
236 # file must be readable by that user at least.
237 # FIXME: is there a better way to do this?
238 chown root "$AUTHORIZED_KEYS"
239 chgrp $(getent passwd "$uname" | cut -f4 -d:) "$AUTHORIZED_KEYS"
240 chmod g+r "$AUTHORIZED_KEYS"
242 # move the resulting authorized_keys file into place
243 mv -f "$AUTHORIZED_KEYS" "${VARLIB}/authorized_keys/${uname}"
245 # destroy temporary directory
250 # generate server gpg key
262 # set default key parameter values
270 TEMP=$(getopt -o e:l:r -l expire:,length:,revoker: -n "$PGRM" -- "$@")
272 if [ $? != 0 ] ; then
276 # Note the quotes around `$TEMP': they are essential!
302 hostName=${1:-$(hostname --fqdn)}
303 userID="ssh://${hostName}"
305 # check for presense of key with user ID
306 if gpg_host --list-key ="$userID" > /dev/null 2>&1 ; then
307 failure "Key for '$userID' already exists"
310 # prompt about key expiration if not specified
311 if [ -z "$keyExpire" ] ; then
312 keyExpire=$(get_gpg_expiration)
314 if ! test_gpg_expire "$keyExpire" ; then
315 failure "invalid key expiration value '$keyExpire'."
319 keyParameters=$(cat <<EOF
321 Key-Length: $keyLength
324 Expire-Date: $keyExpire
328 # add the revoker field if specified
329 # FIXME: the "1:" below assumes that $REVOKER's key is an RSA key.
330 # FIXME: key is marked "sensitive"? is this appropriate?
331 if [ "$revoker" ] ; then
332 keyParameters="${keyParameters}"$(cat <<EOF
333 Revoker: 1:$revoker sensitive
338 echo "The following key parameters will be used for the host private key:"
339 echo "$keyParameters"
341 read -p "Generate key? (Y/n) " OK; OK=${OK:=Y}
342 if [ ${OK/y/Y} != 'Y' ] ; then
347 keyParameters="${keyParameters}"$(cat <<EOF
354 log "generating server key..."
355 echo "$keyParameters" | gpg_host --batch --gen-key
357 # output the server fingerprint
358 fingerprint_server_key "=${userID}"
360 # find the key fingerprint of the newly generated key
361 fingerprint=$(fingerprint_server_key)
363 # export host ownertrust to authentication keyring
364 log "setting ultimate owner trust for server key..."
365 echo "${fingerprint}:6:" | gpg_authentication "--import-ownertrust"
367 # translate the private key to ssh format, and export to a file
369 # NOTE: assumes that the primary key is the proper key to use
371 gpg_host --export-secret-key "$fingerprint" | \
372 openpgp2ssh "$fingerprint" > "${VARLIB}/ssh_host_rsa_key")
373 log "Private SSH host key output to file: ${VARLIB}/ssh_host_rsa_key"
376 # extend the lifetime of a host key:
378 local fpr=$(fingerprint_server_key)
381 if [ -z "$fpr" ] ; then
382 failure "You don't appear to have a MonkeySphere host key on this server. Try 'monkeysphere-server gen-key' first."
385 if [ -z "$extendTo" ]; then
386 extendTo=$(get_gpg_expiration)
388 if ! test_gpg_expire "$extendTo" ; then
389 failure "invalid expiration value '$extendTo'."
392 gpg_host --quiet --command-fd 0 --edit-key "$fpr" <<EOF
397 echo "NOTE: Host key expiration date adjusted, but not yet published."
398 echo "Run '$PGRM publish-key' to publish the new expiration date."
401 # add hostname user ID to server key
409 if [ -z "$1" ] ; then
410 failure "You must specify a hostname to add."
415 fingerprint=$(fingerprint_server_key)
417 # match to only ultimately trusted user IDs
418 tmpuidMatch="u:$(echo $userID | gpg_escape)"
420 # find the index of the requsted user ID
421 # NOTE: this is based on circumstantial evidence that the order of
422 # this output is the appropriate index
423 if line=$(gpg_host --list-keys --with-colons --fixed-list-mode "0x${fingerprint}!" \
424 | egrep '^(uid|uat):' | cut -f2,10 -d: | grep -n -x -F "$tmpuidMatch") ; then
425 failure "Host userID '$userID' already exists."
428 echo "The following user ID will be added to the host key:"
430 read -p "Are you sure you would like to add this user ID? (y/N) " OK; OK=${OK:=N}
431 if [ ${OK/y/Y} != 'Y' ] ; then
432 failure "User ID not added."
435 # edit-key script command to add user ID
436 adduidCommand=$(cat <<EOF
445 # execute edit-key script
446 if echo "$adduidCommand" | \
447 gpg_host --quiet --command-fd 0 --edit-key "0x${fingerprint}!" ; then
449 gpg_host --check-trustdb
453 echo "NOTE: User ID added to key, but key not published."
454 echo "Run '$PGRM publish-key' to publish the new user ID."
456 failure "Problem adding user ID."
460 # revoke hostname user ID to server key
470 if [ -z "$1" ] ; then
471 failure "You must specify a hostname to revoke."
474 echo "WARNING: There is a known bug in this function."
475 echo "This function has been known to occasionally revoke the wrong user ID."
476 echo "Please see the following bug report for more information:"
477 echo "http://monkeysphere.info/bugs/revoke-hostname-revoking-wrong-userid/"
478 read -p "Are you sure you would like to proceed? (y/N) " OK; OK=${OK:=N}
479 if [ ${OK/y/Y} != 'Y' ] ; then
485 fingerprint=$(fingerprint_server_key)
487 # match to only ultimately trusted user IDs
488 tmpuidMatch="u:$(echo $userID | gpg_escape)"
490 # find the index of the requsted user ID
491 # NOTE: this is based on circumstantial evidence that the order of
492 # this output is the appropriate index
493 if line=$(gpg_host --list-keys --with-colons --fixed-list-mode "0x${fingerprint}!" \
494 | egrep '^(uid|uat):' | cut -f2,10 -d: | grep -n -x -F "$tmpuidMatch") ; then
497 failure "No non-revoked user ID '$userID' is found."
500 echo "The following host key user ID will be revoked:"
502 read -p "Are you sure you would like to revoke this user ID? (y/N) " OK; OK=${OK:=N}
503 if [ ${OK/y/Y} != 'Y' ] ; then
504 failure "User ID not revoked."
507 message="Hostname removed by monkeysphere-server $DATE"
509 # edit-key script command to revoke user ID
510 revuidCommand=$(cat <<EOF
522 # execute edit-key script
523 if echo "$revuidCommand" | \
524 gpg_host --quiet --command-fd 0 --edit-key "0x${fingerprint}!" ; then
526 gpg_host --check-trustdb
530 echo "NOTE: User ID revoked, but revocation not published."
531 echo "Run '$PGRM publish-key' to publish the revocation."
533 failure "Problem revoking user ID."
537 # publish server key to keyserver
538 publish_server_key() {
539 read -p "Really publish host key to $KEYSERVER? (y/N) " OK; OK=${OK:=N}
540 if [ ${OK/y/Y} != 'Y' ] ; then
541 failure "key not published."
544 # find the key fingerprint
545 fingerprint=$(fingerprint_server_key)
548 gpg_authentication "--keyserver $KEYSERVER --send-keys '0x${fingerprint}!'"
552 # * check on the status and validity of the key and public certificates
565 # FIXME: what's the correct, cross-platform answer?
566 sshd_config=/etc/ssh/sshd_config
567 seckey=$(gpg_host --list-secret-keys --fingerprint --with-colons --fixed-list-mode)
568 keysfound=$(echo "$seckey" | grep -c ^sec:)
570 # warn when anything is 2 months away from expiration
571 warnwindow='2 months'
572 warndate=$(date +%s -d "$warnwindow")
574 echo "Checking host GPG key..."
575 if (( "$keysfound" < 1 )); then
576 echo "! No host key found."
577 echo " - Recommendation: run 'monkeysphere-server gen-key'"
578 elif (( "$keysfound" > 1 )); then
579 echo "! More than one host key found?"
580 # FIXME: recommend a way to resolve this
582 create=$(echo "$seckey" | grep ^sec: | cut -f6 -d:)
583 expire=$(echo "$seckey" | grep ^sec: | cut -f7 -d:)
584 fingerprint=$(echo "$seckey" | grep ^fpr: | head -n1 | cut -f10 -d:)
585 # check for key expiration:
586 if [ "$expire" ]; then
587 if (( "$expire" < "$curdate" )); then
588 echo "! Host key is expired."
589 echo " - Recommendation: extend lifetime of key with 'monkeysphere-server extend-key'"
590 elif (( "$expire" < "$warndate" )); then
591 echo "! Host key expires in less than $warnwindow:" $(date -d "$(( $expire - $curdate )) seconds" +%F)
592 echo " - Recommendation: extend lifetime of key with 'monkeysphere-server extend-key'"
597 if [ "$create" ] && (( "$create" > "$curdate" )); then
598 echo "! Host key was created in the future(?!). Is your clock correct?"
599 echo " - Recommendation: Check clock ($(date +%F_%T)); use NTP?"
602 # check for UserID expiration:
603 echo "$seckey" | grep ^uid: | cut -d: -f6,7,10 | \
604 while IFS=: read create expire uid ; do
605 # FIXME: should we be doing any checking on the form
606 # of the User ID? Should we be unmangling it somehow?
608 if [ "$create" ] && (( "$create" > "$curdate" )); then
609 echo "! User ID '$uid' was created in the future(?!). Is your clock correct?"
610 echo " - Recommendation: Check clock ($(date +%F_%T)); use NTP?"
612 if [ "$expire" ] ; then
613 if (( "$expire" < "$curdate" )); then
614 echo "! User ID '$uid' is expired."
615 # FIXME: recommend a way to resolve this
616 elif (( "$expire" < "$warndate" )); then
617 echo "! User ID '$uid' expires in less than $warnwindow:" $(date -d "$(( $expire - $curdate )) seconds" +%F)
618 # FIXME: recommend a way to resolve this
623 # FIXME: verify that the host key is properly published to the
624 # keyservers (do this with the non-privileged user)
626 # FIXME: check that there are valid, non-expired certifying signatures
627 # attached to the host key after fetching from the public keyserver
628 # (do this with the non-privileged user as well)
630 # FIXME: propose adding a revoker to the host key if none exist (do we
631 # have a way to do that after key generation?)
633 # Ensure that the ssh_host_rsa_key file is present and non-empty:
635 echo "Checking host SSH key..."
636 if [ ! -s "${VARLIB}/ssh_host_rsa_key" ] ; then
637 echo "! The host key as prepared for SSH (${VARLIB}/ssh_host_rsa_key) is missing or empty."
639 if [ $(stat -c '%a' "${VARLIB}/ssh_host_rsa_key") != 600 ] ; then
640 echo "! Permissions seem wrong for ${VARLIB}/ssh_host_rsa_key -- should be 0600."
643 # propose changes needed for sshd_config (if any)
644 if ! grep -q "^HostKey[[:space:]]\+${VARLIB}/ssh_host_rsa_key$" "$sshd_config"; then
645 echo "! $sshd_config does not point to the monkeysphere host key (${VARLIB}/ssh_host_rsa_key)."
646 echo " - Recommendation: add a line to $sshd_config: 'HostKey ${VARLIB}/ssh_host_rsa_key'"
648 if badhostkeys=$(grep -i '^HostKey' "$sshd_config" | grep -q -v "^HostKey[[:space:]]\+${VARLIB}/ssh_host_rsa_key$") ; then
649 echo "! $sshd_config refers to some non-monkeysphere host keys:"
651 echo " - Recommendation: remove the above HostKey lines from $sshd_config"
656 # FIXME: look at the ownership/privileges of the various keyrings,
657 # directories housing them, etc (what should those values be? can
658 # we make them as minimal as possible?)
660 # FIXME: look to see that the ownertrust rules are set properly on the
661 # authentication keyring
663 # FIXME: make sure that at least one identity certifier exists
666 echo "Checking for MonkeySphere-enabled public-key authentication for users ..."
667 # Ensure that User ID authentication is enabled:
668 if ! grep -q "^AuthorizedKeysFile[[:space:]]\+${VARLIB}/authorized_keys/%u$" "$sshd_config"; then
669 echo "! $sshd_config does not point to monkeysphere authorized keys."
670 echo " - Recommendation: add a line to $sshd_config: 'AuthorizedKeysFile ${VARLIB}/authorized_keys/%u'"
672 if badauthorizedkeys=$(grep -i '^AuthorizedKeysFile' "$sshd_config" | grep -q -v "^AuthorizedKeysFile[[:space:]]\+${VARLIB}/authorized_keys/%u$") ; then
673 echo "! $sshd_config refers to non-monkeysphere authorized_keys files:"
674 echo "$badauthorizedkeys"
675 echo " - Recommendation: remove the above AuthorizedKeysFile lines from $sshd_config"
679 # retrieve key from web of trust, import it into the host keyring, and
680 # ltsign the key in the host keyring so that it may certify other keys
690 # set default values for trust depth and domain
696 TEMP=$(getopt -o n:t:d: -l domain:,trust:,depth: -n "$PGRM" -- "$@")
698 if [ $? != 0 ] ; then
702 # Note the quotes around `$TEMP': they are essential!
729 if [ -z "$keyID" ] ; then
730 failure "You must specify the key ID of a key to add."
734 # get the key from the key server
735 gpg_authentication "--keyserver $KEYSERVER --recv-key '0x${keyID}!'"
737 # get the full fingerprint of a key ID
738 fingerprint=$(gpg_authentication "--list-key --with-colons --with-fingerprint 0x${keyID}!" | \
739 grep '^fpr:' | grep "$keyID" | cut -d: -f10)
741 if [ -z "$fingerprint" ] ; then
742 failure "Key '$keyID' not found."
747 gpg_authentication "--fingerprint 0x${fingerprint}!"
749 echo "Are you sure you want to add the above key as a"
750 read -p "certifier of users on this system? (y/N) " OK; OK=${OK:-N}
751 if [ "${OK/y/Y}" != 'Y' ] ; then
752 failure "Identity certifier not added."
755 # export the key to the host keyring
756 gpg_authentication "--export 0x${fingerprint}!" | gpg_host --import
758 if [ "$trust" == marginal ]; then
760 elif [ "$trust" == full ]; then
763 failure "Trust value requested ('$trust') was unclear (only 'marginal' or 'full' are supported)."
767 # NOTE: *all* user IDs will be ltsigned
768 ltsignCommand=$(cat <<EOF
780 if echo "$ltsignCommand" | \
781 gpg_host --quiet --command-fd 0 --edit-key "0x${fingerprint}!" ; then
783 # update the trustdb for the authentication keyring
784 gpg_authentication "--check-trustdb"
787 echo "Identity certifier added."
789 failure "Problem adding identify certifier."
793 # delete a certifiers key from the host keyring
799 if [ -z "$keyID" ] ; then
800 failure "You must specify the key ID of a key to remove."
803 if gpg_authentication "--no-options --list-options show-uid-validity --keyring ${GNUPGHOME_AUTHENTICATION}/pubring.gpg --list-key 0x${keyID}!" ; then
804 read -p "Really remove above listed identity certifier? (y/N) " OK; OK=${OK:-N}
805 if [ "${OK/y/Y}" != 'Y' ] ; then
806 failure "Identity certifier not removed."
812 # delete the requested key
813 if gpg_authentication "--delete-key --batch --yes 0x${keyID}!" ; then
814 # delete key from host keyring as well
815 gpg_host --delete-key --batch --yes "0x${keyID}!"
816 # update the trustdb for the authentication keyring
817 gpg_authentication "--check-trustdb"
820 echo "Identity certifier removed."
822 failure "Problem removing identity certifier."
826 # list the host certifiers
831 # find trusted keys in authentication keychain
832 keys=$(gpg_authentication "--no-options --list-options show-uid-validity --keyring ${GNUPGHOME_AUTHENTICATION}/pubring.gpg --list-keys --with-colons --fingerprint" | \
833 grep ^pub: | cut -d: -f2,5 | egrep '^(u|f):' | cut -d: -f2)
836 for key in $keys ; do
837 gpg_authentication "--no-options --list-options show-uid-validity --keyring ${GNUPGHOME_AUTHENTICATION}/pubring.gpg --list-key --fingerprint $key"
841 # issue command to gpg-authentication keyring
842 gpg_authentication_cmd() {
843 gpg_authentication "$@"
846 ########################################################################
848 ########################################################################
850 # unset variables that should be defined only in config file
852 unset AUTHORIZED_USER_IDS
853 unset RAW_AUTHORIZED_KEYS
854 unset MONKEYSPHERE_USER
856 # load configuration file
857 [ -e ${MONKEYSPHERE_SERVER_CONFIG:="${ETC}/monkeysphere-server.conf"} ] && . "$MONKEYSPHERE_SERVER_CONFIG"
859 # set empty config variable with ones from the environment, or with
861 KEYSERVER=${MONKEYSPHERE_KEYSERVER:=${KEYSERVER:="subkeys.pgp.net"}}
862 AUTHORIZED_USER_IDS=${MONKEYSPHERE_AUTHORIZED_USER_IDS:=${AUTHORIZED_USER_IDS:="%h/.config/monkeysphere/authorized_user_ids"}}
863 RAW_AUTHORIZED_KEYS=${MONKEYSPHERE_RAW_AUTHORIZED_KEYS:=${RAW_AUTHORIZED_KEYS:="%h/.ssh/authorized_keys"}}
864 MONKEYSPHERE_USER=${MONKEYSPHERE_MONKEYSPHERE_USER:=${MONKEYSPHERE_USER:="monkeysphere"}}
867 CHECK_KEYSERVER=${MONKEYSPHERE_CHECK_KEYSERVER:="true"}
868 REQUIRED_USER_KEY_CAPABILITY=${MONKEYSPHERE_REQUIRED_USER_KEY_CAPABILITY:="a"}
869 GNUPGHOME_HOST=${MONKEYSPHERE_GNUPGHOME_HOST:="${VARLIB}/gnupg-host"}
870 GNUPGHOME_AUTHENTICATION=${MONKEYSPHERE_GNUPGHOME_AUTHENTICATION:="${VARLIB}/gnupg-authentication"}
872 # export variables needed in su invocation
875 export MONKEYSPHERE_USER
877 export CHECK_KEYSERVER
878 export REQUIRED_USER_KEY_CAPABILITY
879 export GNUPGHOME_HOST
880 export GNUPGHOME_AUTHENTICATION
885 [ "$COMMAND" ] || failure "Type '$PGRM help' for usage."
889 'update-users'|'update-user'|'u')
901 'add-hostname'|'add-name'|'n+')
905 'revoke-hostname'|'revoke-name'|'n-')
909 'show-key'|'show'|'s')
913 'publish-key'|'publish'|'p')
921 'add-identity-certifier'|'add-id-certifier'|'add-certifier'|'c+')
925 'remove-identity-certifier'|'remove-id-certifier'|'remove-certifier'|'c-')
926 remove_certifier "$@"
929 'list-identity-certifiers'|'list-id-certifiers'|'list-certifiers'|'list-certifier'|'c')
933 'gpg-authentication-cmd')
934 gpg_authentication_cmd "$@"
937 '--help'|'help'|'-h'|'h'|'?')
942 failure "Unknown command: '$COMMAND'
943 Type '$PGRM help' for usage."