
WDELogbook entry· 3 min read
Cara Menambah SSH Key ke GitHub
Langkah mudah menambahkan SSH Key ke GitHub agar proses clone, push, dan pull lebih aman dan praktis.
3 min read

WDELogbook entry· 3 min read
Langkah mudah menambahkan SSH Key ke GitHub agar proses clone, push, dan pull lebih aman dan praktis.
---
An SSH Key is a pair of cryptographic keys used to authenticate your computer to GitHub. The public key is shared with GitHub, while the private key stays safe on your device. This method is more secure and convenient than using passwords.
---
First, you need to generate a new SSH Key. Open your terminal and run:
Press enter again to use the default file location. Then you'll see:
Enter a passphrase for extra security (optional, but recommended). If you set a passphrase, you'll be asked for it every time you use the key. If you leave it empty, you won't be prompted.
You'll get a confirmation like this:
---
After generating your SSH Key, you need to add the public key to GitHub. In your terminal, run:
You'll see output like this:
Copy all the text that appears. Then go to github.com and log in to your account.
---
Now, let's test your SSH Key by cloning a repository. Go to your GitHub repo, click the Code button, select SSH, and copy the URL.
Open your terminal and run:
Type yes and press enter. If you see this:
Enter your passphrase if you set one. If successful, you've now accessed your GitHub repository using SSH Key!
You must be logged in to comment
No comments yet. Be the first to comment!
@liupurnomo
I'm a Software Engineer who turns coffee into code, and sometimes I even make interactive web things that work! ☕💻 I'm also a certified multitasker: an Expert Drone Pilot (ask me for aerial selfies!), a Certified Instructor/Public Speaker (I talk a lot), and a Seasonal Runner who believes in running only when the weather is perfect. Let's connect!


If you have recently upgraded to Next.js 15 or started a new project, you might have encountered this frustrating error when working with dynamic routes:



Nextjs 16 adalah versi yang baru dari Next, framework React populer. Prisma merupakan ORM yang mempermudah akses data ke database. Artikel ini memberikan contoh setup awal untuk Nextjs 16 dan Prisma 7.



If you are struggling with MDX tables not rendering in your Next.js project, this guide will help you troubleshoot and fix the issue effectively.



Jika Anda kesulitan dengan tabel MDX yang tidak dirender di proyek Next.js Anda, panduan ini akan membantu Anda memecahkan masalah dan memperbaikinya secara efektif.



Pelajari perbedaan performa, konsumsi memori disk, dan cara kerja dependensi antara npm, Yarn, pnpm, serta Bun untuk proyek web modern.

SSH Key is a secure protocol that allows you to access your GitHub repositories without entering your username and password every time. It consists of two parts: a public key (added to GitHub) and a private key (kept on your computer). This guide will walk you through the process of adding an SSH Key to GitHub, step by step, so you can push and pull code more securely and efficiently. Setelah setup SSH Key selesai, Anda bisa mempelajari Git Flow untuk pemula untuk workflow yang lebih terstruktur.
1ssh-keygen -t rsa -C "[email protected]"
Replace youexample.com with your GitHub email. Press enter and you'll see something like:
1Generating public/private rsa key pair.
2Enter file in which to save the key (/Users/you/.ssh/id_rsa):
1Enter passphrase (empty for no passphrase):
2Enter same passphrase again:
1Your identification has been saved in /Users/you/.ssh/id_rsa.
2Your public key has been saved in /Users/you/.ssh/id_rsa.pub.
3The key fingerprint is:
4SHA256:randomTeXTSSHforYOuG!thub543dsasasasasa [email protected]
5+---[RSA 2048]----+
6| =*o+o. |
7| +o+o+ |
8| o+o+ |
9| o+o . |
10| o.S |
11| . o |
12| . |
13+----[SHA256]-----+
1cat ~/.ssh/id_rsa.pub
1ssh-rsa randomTeXTSSHforYOuG!thub543dsasasasasaandMOreManyText= [email protected]
1. Click your profile icon (top right) and go to Settings. 2. In the left menu, click SSH and GPG keys. 3. Click New SSH key. 4. Enter a Title (e.g. your computer name). 5. For Key Type, choose Authentication Key. 6. Paste your copied key into the Key field. 7. Click Add SSH key.
1git clone [email protected]:user-name/private-ssh-url.git
Replace user-name with your GitHub username and private-ssh-url with the URL you copied. Press enter. If you see this:
1Cloning into 'your-repo'...
2The authenticity of host 'github.com (20.205.243.166)' can't be established.
3ED25519 key fingerprint is SHA256:sekianSekianSekiannnnnnnn.
4This key is not known by any other names.
5Are you sure you want to continue connecting (yes/no/[fingerprint])?
1Enter passphrase for key '/c/Users/fse1/.ssh/id_rsa':