title: Git- How to kill ssh-agent properly on Linux
body: <p>I am using git on linux, when pushing to gitlab, sometimes it either stuck at:</p>
  <blockquote>
  <p>debug1: Connecting to gitlab.com [52.167.219.168] port 22.</p>
  </blockquote>
  <p>or</p>
  <blockquote>
  <p>debug1: client_input_channel_req: channel 0 rtype keepalive@openssh.com reply 1</p>
  <p>debug3: send packet: type 100</p>
  </blockquote>
  <p>Seems restarting linux could solve it, but no body like to reboot machines.
  So, I am trying to kill ssh-agent process, then restart it.</p>
  <p>But the process is always <code>defunct</code> after kill, and then I can't use git via ssh at all, so is there any way to restart the ssh-agent, or solve the issue described above without restarting the machine?</p>
  <hr />
  <p><strong>@Update</strong></p>
  <p>The ssh keys that I use include key phrase, which I would input on first use of a ssh key.</p>
  <p>The issue usually occurs after I bring the Linux desktop back from sleep, thus the network is reconnected, not sure whether this matters?</p>
  <p>Again, does any one knows how to kill or restart a <code>ssh-agent</code> agent, without making it become <code>defunct</code>?</p>