ssh-agent in new terminal window

You are smart. You use ssh-agent. But when you start a new terminal, you have to start ssh-agent again. That is annoying.

If you put this in your .bashrc then you only need to enter your pass phrase once:

alias sshr='export SSH_AUTH_SOCK=`cat ~/.ssh/SSH_AUTH_SOCK`;export SSH_AGENT_PID=`cat ~/.ssh/SSH_AGENT_PID`;'
alias ssha='ssh-add -l || eval `ssh-agent` ssh-add ~/.ssh/{identity,id_*[^b]} && echo $SSH_AUTH_SOCK > ~/.ssh/SSH_AUTH_SOCK && echo $SSH_AGENT_PID > ~/.ssh/SSH_AGENT_PID'
sshr
ssha
Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to ssh-agent in new terminal window

  1. Pingback: New Linux installation checklist | Ole Tange

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s