Skip to content

Commit

Permalink
convert openssh key to rsa
Browse files Browse the repository at this point in the history
  • Loading branch information
umagmrit committed May 19, 2020
1 parent 213a44f commit c839577
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/bin/zmsshkeygen
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ fi
ssh-keygen -f ${keyfile} -b 2048 -N '' \
-t ${keytype} -C ${zimbra_server_hostname}

# Starting with OpenSSH 7.8 by default, the key is created with the OpenSSH private key format instead of the OpenSSL PEM format.
# Check the format of KEY, and create KEY in OpenSSL PEM format.
grep "BEGIN OPENSSH PRIVATE KEY" ${keyfile} > /dev/null 2>&1
if [ $? = 0 ]; then
ssh-keygen -m PEM -f ${keyfile} -b 2048 -N '' \ -t ${keytype} -C ${zimbra_server_hostname}
fi
pubkey=`cat ${keyfile}.pub`

${zmprov} ms ${zimbra_server_hostname} ${keyattr} "${pubkey}"

0 comments on commit c839577

Please sign in to comment.