Last active
March 29, 2016 18:58
-
-
Save marioblas/cf7a87e86105f8d5b735 to your computer and use it in GitHub Desktop.
🔐 Generating SSH keys
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
# References: | |
# https://help.github.com/articles/generating-ssh-keys/ | |
# https://help.github.com/articles/working-with-ssh-key-passphrases/ | |
############################################################################### | |
# 1. Check for SSH keys | |
############################################################################### | |
# List the files in your .ssh directory, if they exist | |
ls -al ~/.ssh | |
############################################################################### | |
# 2. Generate a new SSH key | |
############################################################################### | |
# Create a new ssh key, using the provided email as a label | |
ssh-keygen -t rsa -C "[email protected]" | |
# Then add your new key to the ssh-agent: | |
# start the ssh-agent in the background | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
############################################################################### | |
# 3. Add your SSH key to your account | |
############################################################################### | |
# Copy the contents of the id_rsa.pub file to your clipboard | |
pbcopy < ~/.ssh/id_rsa.pub | |
# Add to your Github account for example | |
# Settings → SSH keys → Add SSH key → Add a label & paste your key → Add key | |
############################################################################### | |
# 4. Test everything out | |
############################################################################### | |
# Attempts to SHH to GitHub | |
# Answer → yes | |
ssh -T [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment