Re-wrinting of AgentLoader, SSHAgentMemoryInfo, StubStartAgent, replacing start_agent by StartAgentSSH. Now SSH_ENV can be initialized with StartAgentSSH, like SASSHIsSetSSHENV=True StartAgentSSH. AgentLoader --stopservices will do following line , SASSHUnregisterSSHENV=True SASSHIsSetSSHENV=True StartAgentSSH --stopservices, and StartAgentSSH can kill PID of SSH_AGENT_PID and unset the variable so new instance can be done and no many agent left in memory...