DEV Community

Mohammad Anisur Rahman
Mohammad Anisur Rahman

Posted on • Edited on

How to Set Up SSH Keys for GitHub on Ubuntu EC2 Instance

In this tutorial, you learn how to generate SSH key for GitHub and clone your GitHub repository in AWS ubuntu server with SSH command.

  • Generate SSH key and add the SSH key
~ ssh-keygen -t ed25519 -C "your_email@example.com"

~ eval "$(ssh-agent -s)"

~ ssh-add ~/.ssh/id_ed25519

Enter fullscreen mode Exit fullscreen mode
  • Copy the newly generated SSH Key and add the SSH key to your GitHub account.
~ cat ~/.ssh/id_ed25519.pub

Enter fullscreen mode Exit fullscreen mode

Now you can initialize git in your project directory and add GitHub repository with SSH command. And you can manage the code with git command.

Top comments (0)