diff --git a/bin/admin-remove-old-ssh-keys.sh b/bin/admin-remove-old-ssh-keys.sh index 452db05..48faeea 100755 --- a/bin/admin-remove-old-ssh-keys.sh +++ b/bin/admin-remove-old-ssh-keys.sh @@ -54,6 +54,7 @@ if [ ! -f "${CONFIG_BASE}settings.ini" ]; then exit; fi # shellcheck source=../config/settings.ini +# shellcheck disable=SC1094 source <(grep "=" "${CONFIG_BASE}settings.ini" | sed 's/ *= */=/g') if [ -z "${key_age}" ]; then echo "A minimnum key age in days must be set in the settings"; @@ -78,7 +79,7 @@ fi # default ssh command # -t is needed for systens when "Defaults requiretty" is set -SSH="ssh -a -x"; +SSH="ssh -a -x -n"; remove_ssh_key() { AUTH_KEY_FILE="${1}"; diff --git a/bin/admin-rotate-ssh-keys.sh b/bin/admin-rotate-ssh-keys.sh index 5ecd15d..983414c 100755 --- a/bin/admin-rotate-ssh-keys.sh +++ b/bin/admin-rotate-ssh-keys.sh @@ -76,6 +76,7 @@ if [ ! -f "${CONFIG_BASE}settings.ini" ]; then exit; fi # shellcheck source=../config/settings.ini +# shellcheck disable=SC1094 source <(grep "=" "${CONFIG_BASE}settings.ini" | sed 's/ *= */=/g') if [ -z "${key_age}" ]; then echo "A minimnum key age in days must be set in the settings"; @@ -124,7 +125,7 @@ fi # default ssh command # -t is needed for systens when "Defaults requiretty" is set -SSH="ssh -a -x"; +SSH="ssh -a -x -n"; # Add the SSH Key to an auth file if it does not exist yet and the auth file does exist # Build bash command to run this diff --git a/bin/admin-test-ssh-keys.sh b/bin/admin-test-ssh-keys.sh index 134b6c6..e37b64d 100755 --- a/bin/admin-test-ssh-keys.sh +++ b/bin/admin-test-ssh-keys.sh @@ -34,6 +34,7 @@ if [ ! -f "${CONFIG_BASE}settings.ini" ]; then exit; fi # shellcheck source=../config/settings.ini +# shellcheck disable=SC1094 source <(grep "=" "${CONFIG_BASE}settings.ini" | sed 's/ *= */=/g') if [ -z "${key_age}" ]; then echo "A minimnum key age in days must be set in the settings"; @@ -49,7 +50,7 @@ if [ ! -f "${CONFIG_BASE}${server_list}" ]; then exit; fi -SSH="ssh -a -x"; +SSH="ssh -a -x -n"; # date command datecmd="date"; if date --version 2>&1 | grep -qi "date: illegal option"; then @@ -92,7 +93,7 @@ while read -r line; do rotate_date=""; if [ -f "${LAST_ROTATE}${hostname}_${username}.last-rotate" ]; then # load last rotate timestamp and get YYYY-MM-DD - rotate_date=$(${datecmd} -d @"$(cat "${LAST_ROTATE}${hostname}_${username}.last-rotate")" +%F); + rotate_date=$(${datecmd} -d "@$(cat "${LAST_ROTATE}${hostname}_${username}.last-rotate")" +%F); fi # check for diff in username / hostname warning_string=""