Created
December 2, 2023 15:42
-
-
Save dzungvu/6cedf15f722f523d2d62078b23ab2cfe to your computer and use it in GitHub Desktop.
create ssh key with custom location and name
This file contains hidden or 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
#create ssh key with specified location and name | |
ssh-keygen -t ed25519 -f ~/.ssh/key_name -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
open ~/.ssh/config | |
#in case config file does not exist | |
touch ~/.ssh/config | |
# >>> content for config file: <<< | |
Host github.com | |
AddKeysToAgent yes | |
UseKeychain yes //remove if you do not pass the passphase for the key | |
IdentityFile ~/.ssh/id_ed25519 | |
# >>> save the config file and back to the terminal window <<< | |
#add your SSH private key to the ssh-agent and store your passphrase in the keychain | |
#if you do not pass the passphase for the key, remove --apple-use-keychain option | |
ssh-add --apple-use-keychain ~/.ssh/id_ed25519 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment