You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
289 B
12 lines
289 B
2 years ago
|
!/bin/sh
|
||
|
|
||
|
read -p "Enter the SSH key: " ssh_key
|
||
|
|
||
|
# Check if the SSH key is in the correct format
|
||
|
if ! echo "$ssh_key" | grep -E '^ssh-([a-zA-Z0-9]+) ([A-Za-z0-9+/]+=*) ([A-Za-z0-9]+@[A-Za-z0-9]+)?$' > /dev/null; then
|
||
|
echo "Invalid SSH key format."
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo "Valid SSH key."
|