_dump/ssh-keygen.sh

15 lines
258 B
Bash
Raw Permalink Normal View History

2024-02-24 14:31:19 +01:00
#!/bin/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