Setting Up an SSH Key on Your Laptop for GitHub Access

To securely connect your laptop to GitHub, you need to establish a trusted relationship using an SSH key. Follow these steps to generate and add your key:

🔗 Full instructions from GitHub


✅ 1. Generate a New SSH Key

Open a terminal:

  • macOS/Linux: Open the Terminal app.
  • Windows: Press Start, type cmd, and open the Command Prompt.

Then enter the following command (replace with your email address):

ssh-keygen -t rsa -b 4096 -C "yourname@kenyon.edu"
  • This creates a new RSA key pair and labels it with your email.
  • You’ll see prompts—just press Enter to accept the defaults:
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press Enter]
Enter passphrase (empty for no passphrase): [Press Enter]
Enter same passphrase again: [Press Enter]

✅ 2. Display Your Public Key

In the terminal, run:

cat ~/.ssh/id_rsa.pub
  • This prints your public key.
  • Copy the entire output—you’ll paste this into GitHub.

✅ 3. Add the SSH Key to GitHub

  1. Go to GitHub and log in.
  2. Click your profile icon (top right) → Settings.
  3. In the left sidebar, click SSH and GPG Keys.
  4. Click the green “New SSH Key” button.
  5. Fill in:
    • Title: A name like "My Laptop" or "Judy's MacBook".
    • Key: Paste the key you copied in step 2.
  6. Click Add SSH Key to save.

After this, GitHub and your laptop will trust each other, allowing you to push and pull code securely.

Scroll to Top