Last active
June 22, 2023 18:48
-
-
Save FernandoCelmer/4607f6539ed998ecfeaccfa0d8be94e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p 'Email: ' email | |
ssh-keygen -t ed25519 -C $email | |
eval "$(ssh-agent -s)" | |
read -p 'SSH File Name: ' configfile | |
read -p 'Host Name: ' confighost | |
read -p 'Host Domain: ' configdomain | |
mv $configfile ~/.ssh/$configfile | |
mv $configfile.pub ~/.ssh/$configfile.pub | |
ssh-add --apple-use-keychain ~/.ssh/$configfile | |
echo -e "\nHost $confighost $configdomain\n AddKeysToAgent yes\n UseKeychain yes\n IdentityFile ~/.ssh/$configfile" >> ~/.ssh/config | |
echo -e "\n=====PUBLIC-KEY=====\n" | |
cat ~/.ssh/$configfile.pub | |
echo -e "\n=====PUBLIC-KEY=====\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment