bashrc & zshrc: make ssh-agent work on SSH sessions

This commit is contained in:
Mika Suomalainen 2013-02-16 10:11:40 +02:00
parent c5a4ec0791
commit 7ecda2f30e
2 changed files with 12 additions and 0 deletions

6
bashrc
View File

@ -206,6 +206,12 @@ if [[ $UNAME = "Darwin" && $USER = "root" ]]; then
fi
# The above requires at least Mountain Lion.
# Copied from http://homepages.see.leeds.ac.uk/~eeaol/notes/2012/03/how_to_only_type_ssh_passphrase_once/
export SSH_AUTH_SOCK=/tmp/$USER.agent
if [[ -n $SSH_CONNECTION ]]; then
ssh-agent -a /tmp/$USER.agent
fi
##### Aliases RJ706I #####
# To get sudo work with aliases.

6
zshrc
View File

@ -138,6 +138,12 @@ export LESS_TERMCAP_us=$'\E[01;32m'
CPUARCH=`uname -p`
UNAME=`uname`
# Copied from http://homepages.see.leeds.ac.uk/~eeaol/notes/2012/03/how_to_only_type_ssh_passphrase_once/
export SSH_AUTH_SOCK=/tmp/$USER.agent
if [[ -n $SSH_CONNECTION ]]; then
ssh-agent -a /tmp/$USER.agent
fi
# If we are on Mac, show hidden files in Finder and enable AirDrop over Ethernet and on unsupported (by Apple) Macs
if [[ $UNAME = "Darwin" ]]; then
defaults write com.apple.finder AppleShowAllFiles TRUE && defaults write com.apple.NetworkBrowser BrowseAllInterfaces 1