add SSH keys in interactive shells

This commit is contained in:
Sami Samhuri 2017-06-08 22:11:28 -07:00
parent a52f1bfcac
commit 22b18854c4
No known key found for this signature in database
GPG key ID: F76F41F04D99808F

4
zshrc
View file

@ -283,11 +283,15 @@ compinit
# 11. SSH Keychain # 11. SSH Keychain
# ================ # ================
if is_interactive && command_exists keychain && [[ -d ~/.ssh ]]; then if is_interactive && command_exists keychain && [[ -d ~/.ssh ]]; then
if command_exists keychain; then
keychain --nogui ~/.ssh/id_rsa*~*.pub(N) keychain --nogui ~/.ssh/id_rsa*~*.pub(N)
KEYCHAINFILE="$HOME/.keychain/$(hostname)-sh" KEYCHAINFILE="$HOME/.keychain/$(hostname)-sh"
if [[ -f $KEYCHAINFILE ]]; then if [[ -f $KEYCHAINFILE ]]; then
source $KEYCHAINFILE >/dev/null source $KEYCHAINFILE >/dev/null
fi fi
elif command_exists ssh-add; then
ssh-add
fi
fi fi
# 12. rbenv and pyenv # 12. rbenv and pyenv