diff --git a/daemon/gvfsbackendsftp.c b/daemon/gvfsbackendsftp.c
index 31c9474..3cdc777 100644
--- a/daemon/gvfsbackendsftp.c
+++ b/daemon/gvfsbackendsftp.c
@@ -695,6 +695,49 @@ get_hostname_and_fingerprint_from_line (const gchar *buffer,
   return TRUE;
 }
 
+static gboolean
+get_hostname_and_ipaddress_from_line (const gchar *buffer,
+				      gchar      **hostname_out,
+				      gchar      **ipaddress_out)
+{
+  gchar *pos;
+  gchar *startpos;
+  gchar *endpos;
+  gchar *hostname = NULL;
+  gchar *ipaddress = NULL;
+  
+  if (g_str_has_prefix (buffer, "Warning: the RSA host key for '"))
+    {
+      pos = strchr (&buffer[31], '\'');
+      if (pos == NULL)
+        return FALSE;
+
+      hostname = g_strndup (&buffer[31], pos - (&buffer[31]));
+
+      startpos = strstr (pos, " differs from the key for the IP address '");
+      if (startpos == NULL)
+        {
+	  g_free (hostname);
+	  return FALSE;
+	}
+
+      startpos = startpos + 42;
+      endpos = strchr (startpos, '\'');
+      if (endpos == NULL)
+        {
+	  g_free (hostname);
+	  return FALSE;
+	}
+      
+      ipaddress = g_strndup (startpos, endpos - startpos);
+    }
+
+  *hostname_out = hostname;
+  *ipaddress_out = ipaddress;
+
+  return TRUE;
+}
+
 static const gchar *
 get_authtype_from_password_line (const char *password_line)
 {
@@ -980,6 +1023,62 @@ handle_login (GVfsBackend *backend,
 	      break;
 	    }
 	}
+      else if (g_str_has_prefix (buffer, "Warning: the RSA host key for '"))
+        {
+	  const gchar *choices[] = {_("Log In Anyway"), _("Cancel Login")};
+	  const gchar *v_choices = (const gchar *)choices;
+	  const gchar *choice_string;
+	  gchar *hostname = NULL;
+	  gchar *ipaddress = NULL;
+	  gint choice;
+	  gchar *message;
+
+	  get_hostname_and_ipaddress_from_line (buffer, &hostname, &ipaddress);
+
+	  message = g_strdup_printf (_("The identity of the remote computer (%s) "
+				       "differs from the key for the IP address %s.\n"
+				       "If you want to be absolutely sure it is safe to continue, "
+				       "contact the system administrator."),
+				     hostname ? hostname : op_backend->host, ipaddress);
+
+	  g_free (hostname);
+	  g_free (ipaddress);
+
+	  if (!g_mount_source_ask_question (mount_source,
+					    message,
+					    &v_choices,
+					    2,
+					    &aborted,
+					    &choice) || 
+	      aborted)
+	    {
+	      g_set_error (error,
+			   G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+			   "%s", _("Login dialog cancelled"));
+	      g_free (message);
+	      ret_val = FALSE;
+	      break;
+	    }
+	  g_free (message); 
+
+	  choice_string = (choice == 0) ? "yes" : "no";
+	  if (!g_output_stream_write_all (reply_stream,
+					  choice_string,
+					  strlen (choice_string),
+					  &bytes_written,
+					  NULL, NULL) ||
+	      !g_output_stream_write_all (reply_stream,
+					  "\n", 1,
+					  &bytes_written,
+					  NULL, NULL))
+	    {
+	      g_set_error (error,
+			   G_IO_ERROR, G_IO_ERROR_PERMISSION_DENIED,
+			   "%s", _("Can't send host identity confirmation"));
+	      ret_val = FALSE;
+	      break;
+	    }
+	}
     }
   
   if (ret_val)
