Use SSH For Your Projects!

Ozer SUBASI
3 min readAug 28, 2023

When your first try at the terminal, you trying to clone your favorite project, you’ll probably(no another way actually) see that “Permission Denied” error. Because your SSH connection with GitHub is corrupted or there is no SSH connection with your computer.

Here is what you need to do;

  1. Click your profile photo on the up-right corner and click Settings tab.

2. And then you’ll see a menu in this page. Find Access tab and click “SSH and GPG keys.

This will navigate you to the SSH page.

Before doing something on this page, we need to create SSH key.

3. You need below code to create SSH key;

ssh-keygen -t ed25519 -C "your_email@example.com"

You must change “your_email@example.com” area to your e-mail address that you use for GitHub.

After that you need to add SSH key to the ssh-agent. Simply run this below code.

eval "$(ssh-agent -s)"
> Agent pid 8556
open ~/.ssh/config
> The file /Users/YOU/.ssh/config does not exist.

---> If the file exist, skip below;
touch ~/.ssh/config
open ~/.ssh/config

---> Copy below and paste to opened file;
Host github.com
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_ed25519

Now, we are into adding Ssh-key to Github. Run below code and you’ll copy your key.

pbcopy < ~/.ssh/id_ed25519.pub

Now you’re ready! Final step is try to clone repository…

That’s all! You’re ready to use GitHub for your projects!

I almost forgot, do not share with strangers! If you share your keys on public, do not forget to destroy your “secret” :)

Now you can easily repeat the steps and create a secure key again.

--

--

Ozer SUBASI

Senior Backend Developer, AWS Community Builder #nodejs #serverless #aws