packerlabs/lab0/gen_keypairs.sh

12 lines
220 B
Bash
Raw Normal View History

2024-12-02 20:32:48 +00:00
#!/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