18 lines
297 B
Text
18 lines
297 B
Text
|
#!/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"
|