2024-02-24 14:31:19 +01:00
|
|
|
#!/bin/bash
|
2023-08-06 22:15:06 +02:00
|
|
|
|
|
|
|
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
|