Lesson 28 +15 XP

What is SSH?

What is SSH?

SSH (Secure Shell) is a safe way to connect to another computer over the network. Git uses it to talk securely with services like GitHub.

The problem it solves

When you push code online, the server needs to know it is really you. SSH gives you a secure, passwordless way to prove your identity.

How SSH works

SSH uses a pair of keys:

  • A private key that stays secret on your computer.
  • A public key that you upload to the service (like GitHub).

The math trick

Anything encrypted with your public key can only be decrypted with your private key. So the server sends you a challenge, you solve it with your private key, and the server knows it is you.

Why use SSH with Git?

  • No passwords to type every time.
  • More secure than a password.
  • Works seamlessly with push and pull.

The public key is safe to share

Your public key is meant to be public. Your private key must never leave your computer or be shared with anyone.

TL;DR

  • SSH is a secure connection protocol.
  • It uses a private key (secret) and a public key (shared).
  • The public key is uploaded to GitHub; the private key stays with you.
  • SSH means secure, passwordless Git operations.