diff --git a/daemon/pkcs11/gkr-pkcs11-daemon.c b/daemon/pkcs11/gkr-pkcs11-daemon.c
index 38e7cd8..e01d3d3 100644
--- a/daemon/pkcs11/gkr-pkcs11-daemon.c
+++ b/daemon/pkcs11/gkr-pkcs11-daemon.c
@@ -221,6 +221,7 @@ gkr_pkcs11_daemon_setup_ssh (void)
 	
 	/* gck-ssh-agent sets the environment variable */
 	gkr_daemon_util_push_environment ("SSH_AUTH_SOCK", g_getenv ("SSH_AUTH_SOCK"));
+	gkr_daemon_util_push_environment ("SSH_AGENT_PID", g_getenv ("SSH_AGENT_PID"));
 
 	gkr_cleanup_register (pkcs11_ssh_cleanup, NULL);
 
diff --git a/pkcs11/ssh-agent/gck-ssh-agent-standalone.c b/pkcs11/ssh-agent/gck-ssh-agent-standalone.c
index 98ea002..f31697a 100644
--- a/pkcs11/ssh-agent/gck-ssh-agent-standalone.c
+++ b/pkcs11/ssh-agent/gck-ssh-agent-standalone.c
@@ -113,6 +113,7 @@ main(int argc, char *argv[])
 	g_io_channel_unref (channel);
 
 	g_print ("SSH_AUTH_SOCK=%s\n", g_getenv ("SSH_AUTH_SOCK"));
+	g_print ("SSH_AGENT_PID=%s\n", g_getenv ("SSH_AGENT_PID"));
 	
 	/* Run a main loop */
 	loop = g_main_loop_new (NULL, FALSE);
diff --git a/pkcs11/ssh-agent/gck-ssh-agent.c b/pkcs11/ssh-agent/gck-ssh-agent.c
index c235726..532be2f 100644
--- a/pkcs11/ssh-agent/gck-ssh-agent.c
+++ b/pkcs11/ssh-agent/gck-ssh-agent.c
@@ -447,6 +447,7 @@ gck_ssh_agent_initialize_with_module (const gchar *prefix, GP11Module *module)
 	}
 	
 	g_setenv ("SSH_AUTH_SOCK", socket_path, TRUE);
+	g_setenv ("SSH_AGENT_PID", "", TRUE);
 	
 	socket_fd = sock;
 	return sock;
