Add message if key was alrady added or removed
This commit is contained in:
4
bin/user-add-ssh-key.sh
Normal file → Executable file
4
bin/user-add-ssh-key.sh
Normal file → Executable file
@@ -127,6 +127,8 @@ add_ssh_key() {
|
||||
echo "${pub_key_write}" >> "${AUTH_KEY_FILE}" || exit 1;
|
||||
${RMV_CHMOD_UW} "${AUTH_KEY_FILE}";
|
||||
${ADD_CHATTR_I} "${AUTH_KEY_FILE}";
|
||||
else
|
||||
echo "[!] Already added";
|
||||
fi;
|
||||
EOF
|
||||
);
|
||||
@@ -171,7 +173,7 @@ while read -r line; do
|
||||
continue;
|
||||
fi
|
||||
|
||||
echo "[+] Add new public key '${SSH_KEY_PUB_FILE}' to: ${username}@${hostname}";
|
||||
echo "[+] Add new public key '${USER_PUBLIC_KEY}' to: ${username}@${hostname}";
|
||||
|
||||
# flags: (not used at the moment)
|
||||
# Possible: U (add to .ssh/authorized_keys)
|
||||
|
||||
Reference in New Issue
Block a user