# setup monkeysphere temp gnupghome directories
mkdir -p -m 750 "$MONKEYSPHERE_SYSDATADIR"/gnupg-host
mkdir -p -m 700 "$MONKEYSPHERE_SYSDATADIR"/gnupg-authentication
+mkdir -p -m 700 "$MONKEYSPHERE_SYSDATADIR"/authorized_keys
cat <<EOF > "$MONKEYSPHERE_SYSDATADIR"/gnupg-authentication/gpg.conf
primary-keyring ${MONKEYSPHERE_SYSDATADIR}/gnupg-authentication/pubring.gpg
keyring ${MONKEYSPHERE_SYSDATADIR}/gnupg-host/pubring.gpg
AuthorizedKeysFile ${MONKEYSPHERE_SYSDATADIR}/authorized_keys/%u
EOF
-# FIXME: teach the "server" about the testuser's key, and update the
-# fake authorized_keys file for testuser!
+# teach the "server" about the testuser's key
+GNUPGHOME="$TEMPDIR"/testuser/.gnupg gpg --export testuser | \
+ monkeysphere-server gpg-authentication-cmd --import
+
+monkeysphere-server update-users testuser
# launch test sshd with the new host key.
echo "### starting sshd..."