Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Created January 28, 2026 09:50
Show Gist options
  • Select an option

  • Save virtualstaticvoid/e34769ca1f4cf3ff6484c7092735dc51 to your computer and use it in GitHub Desktop.

Select an option

Save virtualstaticvoid/e34769ca1f4cf3ff6484c7092735dc51 to your computer and use it in GitHub Desktop.
Make SSH key with email
#!/bin/bash
set -e
email=$1
usage() {
echo "Usage: $0 <email>"
}
if [ -z "${email}" ]; then
echo "Error: Email address is required."
usage
exit 1
fi
ssh-keygen -t rsa -b 4096 -C $email -f id_rsa -N ''
echo -e "\nGenerated SSH key"
cat id_rsa.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment