BM: Baca dalam Bahasa Melayu
World 4: Hello GitHub
SSH keys and gh auth login
You will learn: how to let your computer prove who you are, with a key pair or with gh.
The problem
You push many times a day. Can your laptop prove it’s you, with nothing to type?
Pick one answer.
Watch
Think of a padlock and its key. Give GitHub the padlock. Keep the key. An SSH key: A key pair. The private key stays on your computer. The public key goes to GitHub. works the same way. Sort the two halves.
Drag a card into a box. Or tap the card, then tap the box.
Hint
.pub means public. Public is the padlock.Try it
Build the command that makes a new key pair.
Tap the pieces in the right order.
Hint
The tool is ssh-keygen. The type is ed25519.Watch
It asks where to save. Press Enter for the usual place. Then pick a passphrase: a password for the key itself. cat prints the public key to copy.
Predict
GitHub has your padlock now. Which remote address uses SSH?
Pick one answer.
Watch
Paste the .pub key in GitHub: Settings, then SSH and GPG keys. Then test it. “Hi you!” means the padlock fits.
Check
Key habits: good, or needs work? Swipe each one.
Swipe right for good, left for needs work. Or use the buttons.
Protect your key with a passphrase
Watch
Shortcut: the GitHub CLI (gh): A free tool that talks to GitHub from your terminal. Its command is gh.. Run gh auth login. Pick GitHub.com, then HTTPS or SSH. Sign in with your browser. It can set up Git for you too.
Try it
Pick one way and do it for real. Tick each step.
Mission: Git signs in by itself
ssh-keygen -t ed25519 -C "you@example.com"cat ~/.ssh/id_ed25519.pubssh -T git@github.com
0 of 5 steps done · Your ticks are saved.
Hint
On Windows, use Git Bash for these commands.You did it!
You can now connect to GitHub with an SSH key or gh.
Go deeper (optional)
Already have an HTTPS remote? Switch it: git remote set-url origin git@github.com:you/diary.git. The ssh-agent can remember your passphrase for a whole session. The first SSH test asks you to trust github.com. Check its fingerprint on docs.github.com first.
Bahasa Melayu
Anda push banyak kali sehari. Bolehkah laptop buktikan itu anda, tanpa menaip apa-apa?
Bayangkan mangga dan kuncinya. Beri GitHub mangga itu. Simpan kuncinya. Kunci SSH berfungsi begitu juga. Asingkan dua bahagiannya.
Bina arahan untuk buat sepasang kunci baru.
Ia tanya mana nak simpan. Tekan Enter untuk tempat biasa. Kemudian pilih passphrase: kata laluan untuk kunci itu. cat papar kunci awam untuk disalin.
GitHub dah ada mangga anda. Alamat remote mana yang guna SSH?
Tampal kunci .pub di GitHub: Settings, kemudian SSH and GPG keys. Kemudian uji. “Hi you!” maksudnya mangga itu padan.
Tabiat kunci: baik, atau perlu dibaiki? Leret setiap satu.
Jalan pintas: GitHub CLI. Jalankan gh auth login. Pilih GitHub.com, kemudian HTTPS atau SSH. Log masuk dengan pelayar. Ia boleh sediakan Git untuk anda juga.
Pilih satu cara dan buat betul-betul. Tanda setiap langkah.
Kini anda boleh sambung ke GitHub dengan kunci SSH atau dengan gh.
You finished this before. Practice is always welcome!
Official docs: Generating a new SSH key · Adding a new SSH key to your account · Testing your SSH connection · gh auth login
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?