Skip to content

Instantly share code, notes, and snippets.

@3ub41r
Created May 23, 2025 16:26
Show Gist options
  • Save 3ub41r/93619a71ed0315831efa2c150387c747 to your computer and use it in GitHub Desktop.
Save 3ub41r/93619a71ed0315831efa2c150387c747 to your computer and use it in GitHub Desktop.
Import SSH Key to Linux Server
# 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