Created
January 27, 2015 14:52
-
-
Save tuxfight3r/99d3938abe6cc99bb3de to your computer and use it in GitHub Desktop.
ssh-agent tricks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##SSHAGENT PPID TRICK for DESKTOP | |
#source ~/.ssh-agent.sh in your .bashrc | |
SSHAGENTPPID=$(ps -eo ppid,comm|awk '/ssh-agent/ {print $1}') | |
if [ -n "$SSHAGENTPPID" ] | |
then | |
export SSH_AUTH_SOCK=`ls /tmp/ssh*/agent.$SSHAGENTPPID` | |
export SSH_AGENT_PID=`pgrep -P $SSHAGENTPPID ssh-agent` | |
echo "SSH agent pid $SSH_AGENT_PID"; | |
else | |
echo "SSH agent is not started !!!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment