Create a wrapper for creating private RSA keys and their publich key equivalent for SSH

This commit is contained in:
Alexander Schäferdiek 2019-09-13 08:23:12 +02:00
parent eb74a94d5c
commit cdc847207f

18
usr/local/bin/ssh-keygen-rsa Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e;
name=$1;
encryption=$2;
if [[ -z "${name}" ]]; then
echo "Usage: ssh-keygen-rsa <name> [<encryptionKeySize>]"
exit 1;
fi
if [[ -z ${encryption} ]]; then
encryption=3072;
fi
openssl genrsa -out "${name}" "${encryption}"
ssh-keygen -y -f "${name}" > "${name}.pub"