From b59fb1ac8a5c3d5bd96fe02c7c16b7f639ddcb75 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 17 May 2008 13:41:31 +0200 Subject: [PATCH] Add SSH key generation script --- gen/gen-ssh.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gen/gen-ssh.sh diff --git a/gen/gen-ssh.sh b/gen/gen-ssh.sh new file mode 100644 index 0000000..e60b2fb --- /dev/null +++ b/gen/gen-ssh.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +set -e + +type=$1 +case "$type" in + rsa|rsa1|dsa) + ;; + ?*) + echo "key type argument invalid" + exit 1 + ;; + *) + echo "key type argument missing" + exit 1 + ;; +esac + +bits=$2 +if test -z "$bits" ; then + echo "bits argument missing" + exit 1 +fi + +arch=$(dpkg-architecture -qDEB_HOST_ARCH) +dso=./setpid-$arch.so + +prefix=keys/ssh/$arch/$type/$bits +rm -rf $prefix +mkdir -p $prefix + +for x in {1..32767} ; do + echo "*** PID $x" + file=$prefix/$x + LD_PRELOAD=$dso SETPID=$x ssh-keygen -t $type -b $bits -P "" -f $file +done -- 2.11.4.GIT