From 081bb1cc4c21a01a31da042d5e09454262683213 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 1 Jun 2023 15:35:12 +0900 Subject: [PATCH] ssh key change file name had .sh.sh extension --- ...hange.sh.sh => authorized_key_location_change.sh} | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) rename bin/{authorized_key_location_change.sh.sh => authorized_key_location_change.sh} (96%) diff --git a/bin/authorized_key_location_change.sh.sh b/bin/authorized_key_location_change.sh similarity index 96% rename from bin/authorized_key_location_change.sh.sh rename to bin/authorized_key_location_change.sh index 6c928a4..91f94d6 100755 --- a/bin/authorized_key_location_change.sh.sh +++ b/bin/authorized_key_location_change.sh @@ -3,8 +3,9 @@ # check if we need to move the users authorized keys to the central location TEST=1; +LIST=0; SKIP_USERS=(); -while getopts ":gs:" opt; do +while getopts ":gls:" opt; do case "${opt}" in g|go) # default we @@ -13,6 +14,9 @@ while getopts ":gs:" opt; do s|skip) SKIP_USERS+=("${OPTARG}"); ;; + l|list) + LIST=1; + ;; \?) echo -e "\n Option does not exist: ${OPTARG}\n"; echo "Use -g for go (run) and -s for users to skip"; @@ -55,6 +59,12 @@ fi; echo "SSH Msater Authorized Key file: ${SSH_MASTER_AUTHORIZED_FILE}"; echo "SSH Authorized Keys file folder: ${SSH_CENTRAL_AUTHORIZED_FILE_FOLDER}"; +if [ ${LIST} -eq 1 ]; + ls -l "${SSH_CENTRAL_AUTHORIZED_FILE_FOLDER}"; + lsattr "${SSH_CENTRAL_AUTHORIZED_FILE_FOLDER}"; + exit; +then; + PRINTF_INFO="%-8s [%3s]: %-25s: %s\n"; # list of user accounts we will never touch NO_ACTION=(root);