How to Fix “Permission Denied (Publickey)” When Cloning from GitHub

Whenever you’re using a new tool or system, the hardest part is getting things set up — especially when it comes to coding. Git and GitHub are incredibly powerful tools for software developers, but they can be a bit tricky in the beginning.

I remember when I started at my first company, I was told the code was in Git and I needed to run some Git commands to pull it down to my local machine. I was lucky to have a helpful coworker who showed me the ropes and pointed me toward useful resources. But still, the process was overwhelming at times.

Every time I worked on a new machine, I had to go through the entire Git setup process again. It was tedious and frustrating. One of the most annoying issues I encountered was getting the error: Permission denied (public key) right after running git clone.

This error is incredibly common for beginners and typically relates to how your SSH keys are configured. In this video, I’ll break down what SSH keys are, how they work, how to fix this error, and how to avoid it in the future. Whether you’re a beginner or just need a refresher, this video will help you get Git working smoothly on your machine.

In this video, you’ll learn:
🔐 What SSH keys are and how they relate to Git and GitHub
🛠️ How to fix the common “Permission Denied (Public Key)” Git error
🧰 Practical steps to diagnose and resolve Git SSH issues

Thank you for watching, and happy coding! 💻
-Henrik

Leave a Reply

Your email address will not be published. Required fields are marked *