kill_ssh_agents 170 B

1234567891011
  1. #!/bin/bash
  2. ####
  3. # Kills all ssh-agents spawned by the current user
  4. ####
  5. for ID in $(pgrep -u $(id -u) "ssh-agent")
  6. do
  7. kill -9 "$ID"
  8. done
  9. echo "SSH Agents killed B)"