mirror of
https://github.com/bartvdbraak/dotfiles.git
synced 2025-04-27 22:51:21 +00:00
Use SSH agent config and passphrase caching
This commit is contained in:
parent
edf5802820
commit
d67f6097c1
2 changed files with 12 additions and 1 deletions
|
@ -2,3 +2,4 @@ alias ll='ls -la'
|
||||||
alias lt='ls --human-readable --size -1 -S --classify'
|
alias lt='ls --human-readable --size -1 -S --classify'
|
||||||
alias nrebuild='sudo nixos-rebuild --use-remote-sudo switch'
|
alias nrebuild='sudo nixos-rebuild --use-remote-sudo switch'
|
||||||
alias code='codium'
|
alias code='codium'
|
||||||
|
alias ssh='ensure_ssh_key; ssh'
|
|
@ -10,5 +10,15 @@ if command -v rg > /dev/null; then
|
||||||
source <(rg --generate=complete-bash)
|
source <(rg --generate=complete-bash)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$SSH_AUTH_SOCK" ]; then
|
||||||
|
eval $(ssh-agent -s) &>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
function ensure_ssh_key {
|
||||||
|
if ! ssh-add -l &>/dev/null; then
|
||||||
|
ssh-add -t 3600 ~/.ssh/id_ed25519
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
PROMPT_DIRTRIM=2
|
PROMPT_DIRTRIM=2
|
||||||
PS1='\[\033[0;33m\][\u@\h:\w]\$\[\033[0m\] '
|
PS1='\[\033[0;33m\][\u@\h:\w]\$\[\033[0m\] '
|
||||||
|
|
Loading…
Reference in a new issue