change default encoding for ssh key generation
parent
8e83daa3a5
commit
49e3312319
|
@ -29,7 +29,7 @@ ssh_dir_permissions() {
|
|||
|
||||
sshkeygen () {
|
||||
local OPTION; local OPTARG; local OPTIND; local pem
|
||||
local encode="-t ecdsa"; local pass
|
||||
local encode; local pass
|
||||
while getopts 'pr' OPTION; do
|
||||
# echo $OPTION $OPTARG
|
||||
case "$OPTION" in
|
||||
|
@ -37,8 +37,8 @@ sshkeygen () {
|
|||
p)
|
||||
pem="-m PEM"
|
||||
;;
|
||||
r)
|
||||
encode="-t rsa"
|
||||
e)
|
||||
encode="-t ecdsa -b 521"
|
||||
;;
|
||||
*)
|
||||
echo unknown sshkeygen option $OPTION
|
||||
|
@ -50,8 +50,8 @@ sshkeygen () {
|
|||
|
||||
[[ ! $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
|
||||
|
||||
ssh-keygen -f $1 $encode -b 521 -C $1 $pass $pem
|
||||
# defualt is rsa 1024
|
||||
ssh-keygen -f $1 $encode -C $1 $pass $pem
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue