Created
May 23, 2025 16:26
-
-
Save 3ub41r/93619a71ed0315831efa2c150387c747 to your computer and use it in GitHub Desktop.
Import SSH Key to Linux Server
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
# ON LOCAL: | |
# Generate SSH key | |
ssh-keygen -t ed25519 -b 4096 -C "{username@emaildomain.com}" -f ~/.ssh/{ssh-key-name} | |
# Add to SSH Agent | |
ssh-add ~/.ssh/{ssh-key-name} | |
# Add to SSH config | |
Host bitbucket.org | |
AddKeysToAgent yes | |
IdentityFile ~/.ssh/{ssh-key-name} | |
# ON SERVER: | |
# Copy on server | |
echo public_key_string >> ~/.ssh/authorized_keys | |
# References | |
https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server | |
https://support.atlassian.com/bitbucket-cloud/docs/set-up-personal-ssh-keys-on-macos/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment