Skip to content

Instantly share code, notes, and snippets.

@Mukundhan-I2I
Created May 8, 2018 05:18
Show Gist options
  • Save Mukundhan-I2I/c3d47e86711f4939ef28d4782dbf951d to your computer and use it in GitHub Desktop.
Save Mukundhan-I2I/c3d47e86711f4939ef28d4782dbf951d to your computer and use it in GitHub Desktop.
SSH
Open Terminal.
Enter ls -al ~/.ssh to see if existing SSH keys are present:
ls -al ~/.ssh
# Lists the files in your .ssh directory, if they exist
Check the directory listing to see if you already have a public SSH key.
Copy the SSH key to your clipboard.
If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
sudo apt-get install xclip
# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`)
xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard
Tip: If xclip isn't working, you can locate the hidden .ssh folder, open the file in your favorite text editor, and copy it to your clipboard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment