Create a wrapper for creating private RSA keys and their publich key equivalent for SSH
This commit is contained in:
parent
eb74a94d5c
commit
cdc847207f
1 changed files with 18 additions and 0 deletions
18
usr/local/bin/ssh-keygen-rsa
Executable file
18
usr/local/bin/ssh-keygen-rsa
Executable 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"
|
Loading…
Reference in a new issue