Clone repo SSH from GitHub to Ubuntu EC2 AWS

Alfredo Barron
2 min readMar 1, 2024

We learning to generate SSH key in Ubuntu 22 and create deploy key in GitHub that clone repository in our server with SSH.

Step 1. Generate Key to server

In first step, we require to get key using bellow command, So open your terminal or command prompt and run bellow command:

ssh-keygen -t rsa -C "" -b 4096
ssh-keygen -t ed25519 -C ""

Show the created key

cat ~/.ssh/

Copy the key

Step 2. Create Deploy Key

In your GitHub repository go to and create a new key.

If the deploy key is created successful will be display in the SSH and GPG keys list, so now we are ready to clone our repository.