From 29ae892b26753f36a0699b955e95e6839227d23a Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 7 Sep 2015 12:23:34 +0200 Subject: [PATCH] Add an ssh alias to auto-load keychain ssh file if exist. --- zlogin | 12 ------------ zshrc | 3 +++ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/zlogin b/zlogin index 151239a..88d7c38 100644 --- a/zlogin +++ b/zlogin @@ -91,23 +91,11 @@ if [ ${USER} != "root" ]; then 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 keychain --agents ssh id_rsa . $HOME/.keychain/$HOST-sh fi - # Launch Keychain for GPG #[ -f $HOME/.keychain/$HOST-sh-gpg ] && \ #keychain --agents gpg diff --git a/zshrc b/zshrc index 64c3d73..c6d755e 100644 --- a/zshrc +++ b/zshrc @@ -249,6 +249,9 @@ alias ping6="ping6 -c 3" ## JOSM 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 #de l'extension du fichier