Function to add rsa ssh-key to ssh-agent
This commit is contained in:
parent
b1ce539942
commit
8841520957
1
zshenv
1
zshenv
|
@ -107,3 +107,4 @@ SSH_AGENT_SOCK="${HOME}/.ssh/socks/ssh_auth"
|
||||||
SSH_AGENT_ENV="${HOME}/.ssh/socks/ssh_agent_env"
|
SSH_AGENT_ENV="${HOME}/.ssh/socks/ssh_agent_env"
|
||||||
## ssh-keys path
|
## ssh-keys path
|
||||||
SSH_ED25519_KEY="${HOME}/.ssh/id_ed25519"
|
SSH_ED25519_KEY="${HOME}/.ssh/id_ed25519"
|
||||||
|
SSH_RSA_KEY="${HOME}/.ssh/id_rsa"
|
||||||
|
|
10
zshrc
10
zshrc
|
@ -345,6 +345,16 @@ function load-ssh-ed25519() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
# Add rsa ssh-key to ssh-agent {{{
|
||||||
|
function load-ssh-rsa() {
|
||||||
|
# If a RSA ssh-key is available
|
||||||
|
# AND not already loaded in ssh-agent
|
||||||
|
if [ -f "${SSH_RSA_KEY}" ] &&
|
||||||
|
! ssh-add -l | grep -qi -- "(rsa)"; then
|
||||||
|
ssh-add "${SSH_RSA_KEY}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
# }}}
|
||||||
# Clear old entries in known_hosts {{{
|
# Clear old entries in known_hosts {{{
|
||||||
function clearsshkey() {
|
function clearsshkey() {
|
||||||
sed -i "${1}d" ~/.ssh/known_hosts
|
sed -i "${1}d" ~/.ssh/known_hosts
|
||||||
|
|
Loading…
Reference in New Issue