-echo "### testuser connecting to sshd socket..."
-GNUPGHOME="$TEMPDIR"/testuser/.gnupg \
-MONKEYSPHERE_HOME="$TEMPDIR"/testuser/.monkeysphere \
- ssh-agent bash -c \
- 'monkeysphere subkey-to-ssh-agent && ssh -F "$TEMPDIR"/testuser/.ssh/config testhost'
+echo "### ssh connection test for success..."
+ssh_test
+
+# remove the testuser's authorized_user_ids file and update
+# authorized_keys file, this is to make sure that the ssh
+# authentication FAILS...
+echo "### removing testuser authorized_user_ids and reupdating authorized_keys..."
+rm -f "$TEMPDIR"/testuser/.monkeysphere/authorized_user_ids
+monkeysphere-server update-users testuser
+
+# make sure the user can NOT connect
+echo "### ssh connection test for server authentication denial..."
+ssh_test
+if [ "$?" != '255' ] ; then
+ exit
+fi