packerlabs/lab0/gen_keypairs.sh

12 lines
220 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh -eu
N=${1} # how many keys to create
mkdir -p keypairs
for i in $(seq $N);
do
keyfile="../keypairs/user${i}"
[ -s $keyfile ] || ssh-keygen -q -t ed25519 -P "" -C "user${i}@packerlab" -f $keyfile
done