Keychain eingebaut

This commit is contained in:
Michael Grote 2022-07-17 13:25:39 +02:00
parent fe5694fea8
commit 5027fbc824
2 changed files with 4 additions and 19 deletions

View file

@ -4,25 +4,8 @@ if command -v tmux &> /dev/null && [ -z "$TMUX" ]; then
tmux attach -t default || tmux new -s default tmux attach -t default || tmux new -s default
fi fi
### ssh-agent ### keychain
# https://rabexc.org/posts/pitfalls-of-ssh-agents eval $(keychain -q --eval --timeout 60 --agents ssh)
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
### PS1 ### PS1
# git-symbole: * unstaged, + staged, $ stashed, % untracked # git-symbole: * unstaged, + staged, $ stashed, % untracked

View file

@ -1,4 +1,6 @@
### ssh-agent ### ssh-agent
IgnoreUnknown UseKeychain
UseKeychain yes
AddKeysToAgent yes AddKeysToAgent yes
### grote.lan ### grote.lan