Setup SSH authentication untuk GitHub account anda.
- GitHub account (daftar di github.com jika belum ada)
- Git installed di komputer
- Terminal/Command Prompt access
Buka terminal/command prompt dan run:
ssh-keygen -t ed25519 -C "[email protected]"Gantikan [email protected] dengan email GitHub anda.
Nota: Jika system anda tak support ed25519, guna:
ssh-keygen -t rsa -b 4096 -C "[email protected]"Sistem akan tanya:
-
Enter file in which to save the key:
Press ENTER (guna default location) -
Enter passphrase (optional):
Press ENTER untuk kosongkan ATAU Taip password untuk extra security
Output yang anda patut nampak:
Your identification has been saved in /Users/username/.ssh/id_ed25519
Your public key has been saved in /Users/username/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxx [email protected]
Windows (Git Bash):
cat ~/.ssh/id_ed25519.pub | clipWindows (PowerShell):
Get-Content ~/.ssh/id_ed25519.pub | Set-ClipboardmacOS:
pbcopy < ~/.ssh/id_ed25519.pubLinux:
cat ~/.ssh/id_ed25519.pub
# Copy output manually (Ctrl+Shift+C)Output akan nampak macam ni:
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJl3dIeudNqd0PTOXT... [email protected]
-
Pergi ke GitHub:
- Login β Click avatar (top right) β Settings
-
Navigate to SSH Keys:
- Sidebar kiri β SSH and GPG keys
-
Add New Key:
- Click "New SSH key" (button hijau)
-
Fill Form:
- Title:
Laptop [Nama Anda](contoh: "Laptop Ahmad") - Key type: Authentication Key (default)
- Key: Paste public key yang tadi copy
- Title:
-
Save:
- Click "Add SSH key"
- Confirm dengan password GitHub anda
ssh -T [email protected]First time connect, sistem akan tanya:
Are you sure you want to continue connecting (yes/no/fingerprint)?
Taip: yes dan press ENTER
β Success output:
Hi username! You've successfully authenticated, but GitHub does not provide shell access.
β Jika gagal:
# Test dengan verbose
ssh -T [email protected] -v- SSH key generated successfully
- Key added to SSH agent
- Public key added to GitHub
- Connection test successful
- Received "Hi username!" message