Skip to content

Instantly share code, notes, and snippets.

@linuxbiekaisar
Last active February 24, 2020 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linuxbiekaisar/e4723697970be4d39639a87e1fe963d7 to your computer and use it in GitHub Desktop.
Save linuxbiekaisar/e4723697970be4d39639a87e1fe963d7 to your computer and use it in GitHub Desktop.
Generate SSH key and Upload to GitHub
# What is SSH?
# An SSH key is an access credential for the SSH (secure shell) network protocol. This authenticated and encrypted secure network protocol is used for remote communication between machines on an unsecured open network. SSH is used for remote file transfer, network management, and remote operating system access.
# How to check for existing SSH keys?
$ ls -al ~/.ssh
# NOTE: If their is any key u will see id_rsa.pub into a list.
# How to generate a new SSH key and adding it to the ssh-agent?
$ sudo -i
$ ssh-keygen -t rsa -b 4096 -C "linuxbiekaisar@gmail.com"
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa
# How to add the SSH key to your GitHub account?
$ cat /root/.ssh/id_rsa.pub
# Copy the key content and go to your GitHub Seetings> SSH and GPG keys > New SSH Key > Paste the Key > Give a Title > Give GitHub user name and password when asked.
# How to test your SSH connection?
$ ssh -T git@github.com
# Note: When you will success login your will receive a message:
# Hi! You've successfully authenticated, but GitHub does not provide shell access.
# YouTube: https://www.youtube.com/watch?v=N5PNwTx5Bk4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment