Toastie 1 month ago
parent
commit
d252a9e3ce
1 changed files with 12 additions and 0 deletions
  1. 12 0
      crypto/ssh/key-generation.sh

+ 12 - 0
crypto/ssh/key-generation.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+#--Snippet to generate ssh keys------------------------------------------------
+keyUser="USERNAME__PASTE_HERE"
+keyFQDN="FQDN__PASTE_HERE" #full hostname
+#------------------------------------------------------------------------------
+keyType="ed25519"
+keyDate=`date +%F` # format yyyy-mm-dd
+keyPass=`openssl rand -base64 21` # multiple of 3 characters to avoid padding
+keyName="id_"$keyType"_"$keyUser"_"$keyFQDN"_"$keyDate
+ssh-keygen -t ed25519 -C $keyName -N $keyPass -f ./$keyName
+ls $keyName*
+echo $keyPass && unset keyPass