Skip to content

Instantly share code, notes, and snippets.

@schnell18
Last active December 28, 2015 22:49
Show Gist options
  • Save schnell18/7574519 to your computer and use it in GitHub Desktop.
Save schnell18/7574519 to your computer and use it in GitHub Desktop.
Bash script to generate SSH public/private key pairs for a bunch of users.
#!/bin/sh
# read the user name from stdin line by line
while read u
do
rm -f ${u}
rm -f ${u}.pub
ssh-keygen -t rsa -b 2048 -N "" -C "SSH keypair for $u" -f ${u}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment