diff --git a/.bash_extra b/.bash_extra index 4a17124..885897a 100644 --- a/.bash_extra +++ b/.bash_extra @@ -4,25 +4,8 @@ if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then tmux attach -t default || tmux new -s default fi -### ssh-agent -# https://rabexc.org/posts/pitfalls-of-ssh-agents -SSH_ENV="$HOME/.ssh/environment" -function start_agent { - echo "Initialising new SSH agent..." - (umask 066; /usr/bin/ssh-agent > "${SSH_ENV}") - . "${SSH_ENV}" > /dev/null - /usr/bin/ssh-add; -} -# Source SSH settings, if applicable -if [ -f "${SSH_ENV}" ]; then - . "${SSH_ENV}" > /dev/null - ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || { - start_agent; - } -else - start_agent; -fi - +### keychain +eval $(keychain -q --eval --timeout 60 --agents ssh) ### PS1 # git-symbole: * unstaged, + staged, $ stashed, % untracked diff --git a/.ssh/config b/.ssh/config index 430882d..1a67eca 100644 --- a/.ssh/config +++ b/.ssh/config @@ -1,4 +1,6 @@ ### ssh-agent +IgnoreUnknown UseKeychain +UseKeychain yes AddKeysToAgent yes ### grote.lan