From fbe7fa52b8c71e8465d2ec56af5f643cd6123a36 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 25 Oct 2023 14:35:57 +0200 Subject: [PATCH] new: [0km] make ``vps-setup`` support ``ed25519`` ssh keys --- bin/0km | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/0km b/bin/0km index 10c8d22..c9d19ff 100755 --- a/bin/0km +++ b/bin/0km @@ -954,11 +954,14 @@ cmdline.spec::cmd:vps-setup:run() { fi fi + SUPPORTED_KEY_TYPE=(ssh-rsa ssh-ed25519) Section Checking access while read-0 key; do prefix="${key%% *}" - if [ "$prefix" != "ssh-rsa" ]; then + if ! [[ " ${SUPPORTED_KEY_TYPE[*]} " == *" $prefix "* ]]; then err "Unsupported key:"$'\n'"$key" + echo " Please use only key of the following type:" >&2 + printf " - %s\n" "${SUPPORTED_KEY_TYPE[@]}" >&2 return 1 fi label="${key##* }"