Add an ssh alias to auto-load keychain ssh file if exist.

This commit is contained in:
Jeremy Gardais 2015-09-07 12:23:34 +02:00
parent ca89738866
commit 29ae892b26
2 changed files with 3 additions and 12 deletions

12
zlogin
View File

@ -91,23 +91,11 @@ if [ ${USER} != "root" ]; then
fi fi
fi fi
# Launch Keychain for ssh
#if [ -f $HOME/.keychain/$HOST-sh ]; then
#. $HOME/.keychain/$HOST-sh
#else
#if [ -f $HOME/.ssh/id_rsa ]; then
#keychain --agents ssh id_rsa
#. $HOME/.keychain/$HOST-sh
#fi
#fi
if [ -f $HOME/.ssh/id_rsa ]; then if [ -f $HOME/.ssh/id_rsa ]; then
keychain --agents ssh id_rsa keychain --agents ssh id_rsa
. $HOME/.keychain/$HOST-sh . $HOME/.keychain/$HOST-sh
fi fi
# Launch Keychain for GPG # Launch Keychain for GPG
#[ -f $HOME/.keychain/$HOST-sh-gpg ] && \ #[ -f $HOME/.keychain/$HOST-sh-gpg ] && \
#keychain --agents gpg #keychain --agents gpg

3
zshrc
View File

@ -249,6 +249,9 @@ alias ping6="ping6 -c 3"
## JOSM ## JOSM
alias josm="java -jar -Xmx2048M /opt/josm-tested.jar" alias josm="java -jar -Xmx2048M /opt/josm-tested.jar"
## SSH
alias ssh="test -f ~/.keychain/$HOST-sh_&& source ~/.keychain/$HOST-sh; ssh "
####################################### #######################################
#Ouverture d'un programme en fonction #Ouverture d'un programme en fonction
#de l'extension du fichier #de l'extension du fichier