Tuesday, April 16, 2019

How to remove ssh-agent process in redhat


When you log out, you want the ssh-agent process to be terminated automatically.

You can add below command in .bash_profile file

trap 'test -n "$SSH_AGENT_PID" && eval `/usr/bin/ssh-agent -k`' 0

If you need to remove existing processes,

for(( ; ; )); do kill $(ps -ef | grep ssh-agent | grep -v grep  | grep -v grep | awk -F' ' '{print($2)}' | head -1 );echo "done"; done


No comments:

Post a Comment

File Sharing using NFS in GKE Cluster

 File Sharing using NFS in GKE Cluster There was a requirement to create common file sharing location which should be accessible by specific...