_dump/ssh-keygen.sh

15 lines
266 B
Bash
Raw Normal View History

#!/usr/bin/env bash
NEW_SSH_EMAIL="$1"
[ -z "$NEW_SSH_EMAIL" ] \
&& NEW_SSH_EMAIL="rsa-key_$(date +\%Y\%m\%d\%H\%M)"
ssh-keygen \
-t rsa -b 4096 \
-C "$NEW_SSH_EMAIL@dym.sh" \
-f ~/.ssh/$NEW_SSH_EMAIL
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/$NEW_SSH_EMAIL