From: Silvio Rhatto Date: Sun, 2 Apr 2017 01:42:30 +0000 (-0300) Subject: Ensure any previous keys are removed at __kvmx_ssh_keygen X-Git-Tag: 0.1.0~480 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=bccc6e33d394ce12ce89195a3eb0c73c6e2f797a;p=kvmx.git Ensure any previous keys are removed at __kvmx_ssh_keygen --- diff --git a/lib/kvmx/functions b/lib/kvmx/functions index df1bd7a..134f4be 100755 --- a/lib/kvmx/functions +++ b/lib/kvmx/functions @@ -12,6 +12,10 @@ # Generate a keypair function __kvmx_ssh_keygen { if [ ! -z "$2" ]; then + # Ensure any previous keys are removed + rm -f $1 $1.pub + + # Generate the keypair ssh-keygen -t rsa -b 4096 -f $1 -N '' -C $2 fi }