From 559cddb45aa10a4fde775bfcffb2b00018305540 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Wed, 9 Sep 2020 11:21:55 +0200 Subject: [PATCH] ssh function to learn not to use -A --- .functions.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.functions.sh b/.functions.sh index 0a7c5b5..d1d0a66 100644 --- a/.functions.sh +++ b/.functions.sh @@ -85,3 +85,19 @@ function ww(){ ;; esac } + +function ssh(){ + for arg in "$@" + do + case "$arg" in + -A) + read -t 5 -n 1 -s -r -p "Consider to use -o ProxyJump instead! Press 'y' to continue with -A" answer + printf "\n" + if [[ "${answer,,}" != "y" ]]; then + return 1 + fi + esac + done + /usr/bin/ssh "$@" +} +