change default encoding for ssh key generation
parent
8e83daa3a5
commit
49e3312319
|
@ -29,7 +29,7 @@ ssh_dir_permissions() {
|
||||||
|
|
||||||
sshkeygen () {
|
sshkeygen () {
|
||||||
local OPTION; local OPTARG; local OPTIND; local pem
|
local OPTION; local OPTARG; local OPTIND; local pem
|
||||||
local encode="-t ecdsa"; local pass
|
local encode; local pass
|
||||||
while getopts 'pr' OPTION; do
|
while getopts 'pr' OPTION; do
|
||||||
# echo $OPTION $OPTARG
|
# echo $OPTION $OPTARG
|
||||||
case "$OPTION" in
|
case "$OPTION" in
|
||||||
|
@ -37,8 +37,8 @@ sshkeygen () {
|
||||||
p)
|
p)
|
||||||
pem="-m PEM"
|
pem="-m PEM"
|
||||||
;;
|
;;
|
||||||
r)
|
e)
|
||||||
encode="-t rsa"
|
encode="-t ecdsa -b 521"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo unknown sshkeygen option $OPTION
|
echo unknown sshkeygen option $OPTION
|
||||||
|
@ -50,8 +50,8 @@ sshkeygen () {
|
||||||
|
|
||||||
[[ ! $1 ]] && echo must supply a private key name && return 1
|
[[ ! $1 ]] && echo must supply a private key name && return 1
|
||||||
[[ $2 ]] && pass="-P $2" || echo warning, you are creating an unencrypted key without a passphrase
|
[[ $2 ]] && pass="-P $2" || echo warning, you are creating an unencrypted key without a passphrase
|
||||||
|
# defualt is rsa 1024
|
||||||
ssh-keygen -f $1 $encode -b 521 -C $1 $pass $pem
|
ssh-keygen -f $1 $encode -C $1 $pass $pem
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue